diff --git a/lib/memjs/memjs.js b/lib/memjs/memjs.js index af27763..f03a295 100644 --- a/lib/memjs/memjs.js +++ b/lib/memjs/memjs.js @@ -832,12 +832,10 @@ Client.prototype.perform = function(key, request, seq, callback, retries) { // Increment the seq value Client.prototype.incrSeq = function() { + this.seq++; + // Wrap `this.seq` to 32-bits since the field we fit it into is only 32-bits. - if (this.seq == 0xffffffff) { - this.seq = 0; - } else { - this.seq++; - } + this.seq &= 0xffffffff; }; exports.Client = Client;