Browse Source

Small correction to continueWhile

n1073645 5 năm trước cách đây
mục cha
commit
3921b4f445
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      src/core/lib/Stream.mjs

+ 1 - 2
src/core/lib/Stream.mjs

@@ -213,8 +213,7 @@ export default class Stream {
      * @param {Number} val
      */
     consumeWhile(val) {
-        while ((this.position < this.length) && (this.bytes[(this.position++)] === val))
-        this.position--;
+        while ((++this.position < this.length) && (this.bytes[(this.position)] === val));
     }
 
     /**