-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
src: refactor EndsInANumber in node_url.cc and adds IsIPv4NumberValid #46227
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
Merged
nodejs-github-bot
merged 14 commits into
nodejs:main
from
miguelteixeiraa:node-performance-36
Jan 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ff9c478
src: refactor EndsInANumber in node_url.cc and adds IsIPv4NumberValid
miguelteixeiraa f076935
src: fix node_url.cc code formatting
miguelteixeiraa b1f4c83
src: fix node_url.cc code formatting (back to what it was)
miguelteixeiraa 95d3081
src: refactor EndsInANumber in node_url.cc to use string_view::rfind
miguelteixeiraa e9282ad
src: fix imports typo in node_url.cc
miguelteixeiraa a683d34
src: removes unnecessary if statement from EndsInANumber in node_url.cc
miguelteixeiraa d165e39
src: use string_view instead of string in EndsInANumber in node_url.cc
miguelteixeiraa 573dd4a
src: fix string_view constructor call for IsIPv4NumberValid in node_u…
miguelteixeiraa b52bbd4
src: adds minor tweaks to EndsInANumber at node_url.cc
miguelteixeiraa 3074383
src: adds comment to IsIPv4NumberValid conditions in node_url.cc
miguelteixeiraa de4f065
src: cast interators to size_t in IsIPv4NumberValid call in node_url.cc
miguelteixeiraa 9058eb5
src: cast interator to const char* in IsIPv4NumberValid call in node_…
miguelteixeiraa b65769f
src: use &(*it) to make windows build pass + ::all_of instead of ::fi…
miguelteixeiraa 9534455
src: refactor EndsInANumber to be more readable in node_url.cc
miguelteixeiraa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src: fix string_view constructor call for IsIPv4NumberValid in node_u…
…rl.cc
- Loading branch information
commit 573dd4af7dda4da573f6f165f5f5898852a46f1d
There are no files selected for viewing
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
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.
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.
This is too hacky (even if it's guaranteed safe).
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.
removed!
Uh oh!
There was an error while loading. Please reload this page.
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.
I'll try a
static_cast<const char*>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.
@nodejs/cpp-reviewers any recommendations?
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.
Yeah: I would definitely recommeng to go back to the original "hacky" implementation. It works and looks correct, even if it is not visually pretty. (I'd also not call this
pointerif it's an iterator.)const_cast<char*>(pointer_start)doesn't even really make sense since the string_view constructor takes aconst char*argument.Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, I think it only works on the other compilers because their implementations for the iterator are:
std::string_view::iterator' (aka 'const char *')(I purposely caused an error to catch this 'aka' haha)