Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't increment the cursor in the loop #2

Closed
3rd-Eden opened this Issue · 1 comment

1 participant

@3rd-Eden
Owner

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
@3rd-Eden
Owner

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
Something went wrong with that request. Please try again.