readline: replace quadratic regex with linear one#26778
Closed
Hakerh400 wants to merge 1 commit intonodejs:masterfrom
Hakerh400:regex
Closed
readline: replace quadratic regex with linear one#26778Hakerh400 wants to merge 1 commit intonodejs:masterfrom Hakerh400:regex
Hakerh400 wants to merge 1 commit intonodejs:masterfrom
Hakerh400:regex
Conversation
Contributor
|
my 2 bits: I think the test should assert it functions correctly, but not the time complexity of the code. So, testing input designed to trigger quadratic isn't necessary, IMO, but if the test is fast, its not bad to do. A comment as to why the code is written this way would be useful, so someone doesn't come along later and think "aha, I can refactor this into one line with a better regex". |
Contributor
Author
|
Added a comment and updated the test. |
addaleax
reviewed
Mar 19, 2019
Simplify regular expression in _wordLeft readline method.
BridgeAR
approved these changes
Mar 26, 2019
Collaborator
targos
approved these changes
Mar 30, 2019
Member
|
Landed in e4e2b0c |
targos
pushed a commit
that referenced
this pull request
Mar 30, 2019
Simplify regular expression in _wordLeft and _deleteWordLeft readline methods. PR-URL: #26778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
BethGriggs
pushed a commit
that referenced
this pull request
Apr 5, 2019
Simplify regular expression in _wordLeft and _deleteWordLeft readline methods. PR-URL: #26778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
BethGriggs
pushed a commit
that referenced
this pull request
Apr 9, 2019
Simplify regular expression in _wordLeft and _deleteWordLeft readline methods. PR-URL: #26778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
BethGriggs
pushed a commit
that referenced
this pull request
Apr 9, 2019
Simplify regular expression in _wordLeft and _deleteWordLeft readline methods. PR-URL: #26778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simplify regular expression in _wordLeft readline method.
Note: If the test can be improved in any way, let me know. Tried using
FakeInput, but writing one million characters takes a very long time. Or should a benchmark be used instead of the test?Fixes #26596
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes