From 51da5f39f650dfd7aa912e3b39e0b518cc96a896 Mon Sep 17 00:00:00 2001 From: Dominic Tarr Date: Thu, 8 May 2014 23:49:49 +0200 Subject: [PATCH] use bitwise check instead of >= when number is small --- encode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encode.js b/encode.js index 34a11a6..63f5149 100644 --- a/encode.js +++ b/encode.js @@ -14,7 +14,7 @@ function encode(num, out, offset) { out[offset++] = (num & 0xFF) | MSB num /= 128 } - while(num >= 0x80) { + while(num & MSBALL) { out[offset++] = (num & 0xFF) | MSB num >>>= 7 }