-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Remove unnecessary usage of jstoi_q. NFC #23791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3205,7 +3205,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}}; | |
#if GL_DEBUG | ||
console.dir(match); | ||
#endif | ||
explicitUniformLocations[match[5]] = jstoi_q(match[1]); | ||
explicitUniformLocations[match[5]] = Number(match[1]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, is the 5th capture not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are using the first capture here aren't we? That looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, somehow my eye read the |
||
#if GL_TRACK_ERRORS | ||
if (!(explicitUniformLocations[match[5]] >= 0 && explicitUniformLocations[match[5]] < 1048576)) { | ||
err(`Specified an out of range layout(location=x) directive "${explicitUniformLocations[match[5]]}"! (${match[0]})`); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code above is fairly complex - how can I see that this is a pure number without a prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
getMatch
function returns that result of the regex's above.You can see that we only call
Number
on the following matches: S, M, H, I, Y, y, C, m, d, j, U, W.You can look at the above table of regexes and see that each of them only ever match numbers.
We also have pretty extensive testing for strftime I believe.