Don't increment the cursor in the loop #2

3rd-Eden opened this Issue Jan 30, 2013 · 1 comment


None yet

1 participant


There are currently 2 places where we increment the data cursor in our parser.

  1. In the for (var i = 0, l = data.length; i < l; i++) {
  2. In our if (charCode === ...) { statements when we move the cursor over the parser data

We could eliminate the increment in the for loop and add +1 to all our cursor movements.

Thanks for spotting this @ronkorving

@3rd-Eden 3rd-Eden closed this in a16f240 Jan 30, 2013

It didn't make the parser go any faster as far as I can see with the benchmarks, but it's probably more clear that 2 chars are added in the statement instead of 1 char in the if statement and 1 char in loop iteration. So a good fix none the less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment