Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 36 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesevents: simplify stack compare function #24744
Conversation
BridgeAR
requested a review
from
addaleax
Nov 30, 2018
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
events
label
Nov 30, 2018
addaleax
reviewed
Nov 30, 2018
lib/events.js Outdated
| } | ||
| if (matches) | ||
| return [ len, i, j ]; |
This comment has been minimized.
This comment has been minimized.
addaleax
Nov 30, 2018
Member
And for the same reason, returning j might not be used in this specific setup, but it’s part of having this be a more generic function.
This comment has been minimized.
This comment has been minimized.
BridgeAR
Nov 30, 2018
•
Author
Member
pos translates to the former j but I recommend to change the signature when necessary and not to keep code in here that is currently unused.
This comment has been minimized.
This comment has been minimized.
|
Ping @addaleax |
This comment has been minimized.
This comment has been minimized.
|
This needs some reviews. |
This comment has been minimized.
This comment has been minimized.
BridgeAR
requested review from
antsmartian,
jasnell,
joyeecheung,
lundibundi,
mcollina,
refack and
ryzokuken
Dec 6, 2018
| // Returns the length and line number of the first sequence of `a` that fully | ||
| // appears in `b` with a length of at least 4. | ||
| function identicalSequenceRange(a, b) { | ||
| for (var i = 0; i < a.length - 3; i++) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mcollina
Dec 7, 2018
Member
a could be quite big, and it used to be slightly faster to cache the value if it's computed.
This comment has been minimized.
This comment has been minimized.
BridgeAR
Dec 7, 2018
Author
Member
a should normally be small (we currently only use this for stack frames) and this implementation should also be faster than the one before. If it's about performance, I could save a couple comparisons by using a simple for loop instead of indexOf (currently I check until the last entry but the last three entries are not interesting).
@bmeurer do values like these get constant fold?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@mcollina nothing showed up in CITGM (most failures are related due to some windows issues and others to removed V8 functions, the rest is also known). |
This comment has been minimized.
This comment has been minimized.
|
I know this is nothing important but it would still be great to get some reviews here. This PR is open since 14 days and there was neither a +1, nor a -1. |
BridgeAR
added
the
author ready
label
Dec 14, 2018
This comment has been minimized.
This comment has been minimized.
|
Not strictly required, but it would be great to get another review on this one. @addaleax @bnoordhuis @apapirovski @mscdex (There's not |
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Dec 19, 2018
This comment has been minimized.
This comment has been minimized.
|
Landed in a76750b |
BridgeAR commentedNov 30, 2018
This simplifies the
longestSeqContainedIn()logic by checking forthe first identical occurance of at least three frames instead of
the longest one.
It also removes an unused argument.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes