Avoid unnecessary delays
We only use setTimeout() to avoid hanging the browser, not because we actually want a delay. So let's use the smallest delay there is.
This commit is contained in:
parent
5a20f425d4
commit
3af1a3a05b
|
@ -255,7 +255,7 @@ var RFB;
|
||||||
sendPassword: function (passwd) {
|
sendPassword: function (passwd) {
|
||||||
this._rfb_password = passwd;
|
this._rfb_password = passwd;
|
||||||
this._rfb_state = 'Authentication';
|
this._rfb_state = 'Authentication';
|
||||||
setTimeout(this._init_msg.bind(this), 1);
|
setTimeout(this._init_msg.bind(this), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
sendCtrlAltDel: function () {
|
sendCtrlAltDel: function () {
|
||||||
|
@ -549,7 +549,7 @@ var RFB;
|
||||||
this._msgTimer = setTimeout(function () {
|
this._msgTimer = setTimeout(function () {
|
||||||
this._msgTimer = null;
|
this._msgTimer = null;
|
||||||
this._handle_message();
|
this._handle_message();
|
||||||
}.bind(this), 10);
|
}.bind(this), 0);
|
||||||
} else {
|
} else {
|
||||||
Util.Debug("More data to process, existing timer");
|
Util.Debug("More data to process, existing timer");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue