Commit c8e650de authored by Brian White's avatar Brian White
Browse files

querystring: improve unescapeBuffer() performance

Before this, v8 would deopt when an out of bounds `inIndex` would get
passed to charCodeAt(). charCodeAt() returns NaN in such cases, so we
directly emulate that behavior as well.

Also, calls to charCodeAt() for constant strings have been replaced
by the raw character codes and parser state is now stored as an
integer instead of a string. Both of these provide a slight
performance increase.

PR-URL: https://github.com/nodejs/node/pull/5012


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarRoman Reiss <me@silverwind.io>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
parent a2a69a2b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment