Skip to content
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

src: fix and cleanup URL::SerializeURL #41759

Closed

Conversation

Copy link
Member

@addaleax addaleax commented Jan 29, 2022

src: fix query/fragment serialization in URL::SerializeURL

These are presumably typos.

src: reserve string allocation space early in URL::SerializeURL

This can be useful for performance when doing many string
concatenations.

src: use const reference instead of pointer in URL::SerializeURL

Just some general cleanup to make things C++-y instead of C-y.

addaleax added 3 commits Jan 29, 2022
This can be useful for performance when doing many string
concatenations.
Just some general cleanup to make things C++-y instead of C-y.
@nodejs-github-bot nodejs-github-bot added c++ needs-ci whatwg-url labels Jan 29, 2022
@addaleax addaleax added request-ci and removed needs-ci labels Jan 29, 2022
@github-actions github-actions bot removed the request-ci label Jan 29, 2022
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Jan 29, 2022

@Trott Trott requested a review from watilde Jan 30, 2022
src/node_url.cc Show resolved Hide resolved
src/node_url.cc Show resolved Hide resolved
src/node_url.cc Outdated Show resolved Hide resolved
@RaisinTen
Copy link
Member

@RaisinTen RaisinTen commented Jan 30, 2022

src/node_url.cc Outdated Show resolved Hide resolved
if (url->flags & URL_FLAGS_HAS_QUERY) {
output = "?" + url->query;
if (url.flags & URL_FLAGS_HAS_QUERY) {
output += "?" + url.query;
Copy link
Member

@TimothyGu TimothyGu Jan 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo indeed. Do we have tests for SerializeURL?

Copy link
Member Author

@addaleax addaleax Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not explicitly, I think. And I don't quite know where to put regression tests for this either.

Copy link
Member

@RaisinTen RaisinTen Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/node_url.cc Show resolved Hide resolved
@addaleax addaleax added the request-ci label Jan 31, 2022
@addaleax addaleax requested a review from RaisinTen Jan 31, 2022
@github-actions github-actions bot removed the request-ci label Jan 31, 2022
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Jan 31, 2022

Copy link
Member

@RaisinTen RaisinTen left a comment

LGTM

@aduh95 aduh95 added commit-queue commit-queue-rebase labels Feb 11, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue label Feb 11, 2022
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 11, 2022

Landed in ba5b5ac...33ffaa4

nodejs-github-bot pushed a commit that referenced this issue Feb 11, 2022
These are presumably typos.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
nodejs-github-bot pushed a commit that referenced this issue Feb 11, 2022
This can be useful for performance when doing many string
concatenations.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
nodejs-github-bot pushed a commit that referenced this issue Feb 11, 2022
Just some general cleanup to make things C++-y instead of C-y.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
These are presumably typos.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
This can be useful for performance when doing many string
concatenations.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
Just some general cleanup to make things C++-y instead of C-y.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
These are presumably typos.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
This can be useful for performance when doing many string
concatenations.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
Just some general cleanup to make things C++-y instead of C-y.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
@bengl bengl mentioned this pull request Feb 21, 2022
bengl pushed a commit that referenced this issue Feb 22, 2022
These are presumably typos.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit that referenced this issue Feb 22, 2022
This can be useful for performance when doing many string
concatenations.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
bengl pushed a commit that referenced this issue Feb 22, 2022
Just some general cleanup to make things C++-y instead of C-y.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit to danielleadams/node that referenced this issue Apr 21, 2022
These are presumably typos.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit to danielleadams/node that referenced this issue Apr 21, 2022
This can be useful for performance when doing many string
concatenations.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit to danielleadams/node that referenced this issue Apr 21, 2022
Just some general cleanup to make things C++-y instead of C-y.

PR-URL: nodejs#41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
These are presumably typos.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
This can be useful for performance when doing many string
concatenations.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
Just some general cleanup to make things C++-y instead of C-y.

PR-URL: #41759
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready c++ commit-queue-rebase whatwg-url
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants