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:
samhed 2016-06-02 14:57:44 +02:00
parent 5a20f425d4
commit 3af1a3a05b
1 changed files with 2 additions and 2 deletions

View File

@ -255,7 +255,7 @@ var RFB;
sendPassword: function (passwd) {
this._rfb_password = passwd;
this._rfb_state = 'Authentication';
setTimeout(this._init_msg.bind(this), 1);
setTimeout(this._init_msg.bind(this), 0);
},
sendCtrlAltDel: function () {
@ -549,7 +549,7 @@ var RFB;
this._msgTimer = setTimeout(function () {
this._msgTimer = null;
this._handle_message();
}.bind(this), 10);
}.bind(this), 0);
} else {
Util.Debug("More data to process, existing timer");
}