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

url: const-ify APIs, and pass URL by ref #15615

Closed
wants to merge 1 commit into from

Conversation

sam-github
Copy link
Contributor

Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src,url

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Sep 25, 2017
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.
@sam-github
Copy link
Contributor Author

@BridgeAR
Copy link
Member

BridgeAR commented Oct 1, 2017

Landed in af6af08

@BridgeAR BridgeAR closed this Oct 1, 2017
BridgeAR pushed a commit that referenced this pull request Oct 1, 2017
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.

PR-URL: #15615
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
@mscdex
Copy link
Contributor

mscdex commented Oct 2, 2017

@sam-github @BridgeAR This PR is causing a compiler error on Windows: https://ci.nodejs.org/job/node-compile-windows/12033/label=win-vs2017/console

src\node_url.cc(2127): error C2664: 'bool node::url::ToUnicode(std::string *,std::string *)': cannot convert argument 1 from 'const std::string *' to 'std::string *'

@BridgeAR
Copy link
Member

BridgeAR commented Oct 2, 2017

@mscdex thanks, I was just trying to figure out which commit it was as I also realized that something went wrong. I misread the CI results. This should get fixed soon. Should I just open a revert for this?

@BridgeAR
Copy link
Member

BridgeAR commented Oct 2, 2017

I am reopening this until this gets solved.

@BridgeAR BridgeAR reopened this Oct 2, 2017
bnoordhuis added a commit to bnoordhuis/io.js that referenced this pull request Oct 2, 2017
Commit af6af08 introduced a build error in a Windows-only code path in
src/node_url.cc.

Fix it by making the code a little nicer in general: const-ify the
`input` parameter to `ToASCII()` and `ToUnicode()`.

Refs: nodejs#15615
Refs: nodejs#15723
lpinca added a commit to lpinca/node that referenced this pull request Oct 2, 2017
@gibfahn
Copy link
Member

gibfahn commented Oct 2, 2017

I think this can be closed again, either #15724 or #15723 should fix it.

@gibfahn gibfahn closed this Oct 2, 2017
lpinca pushed a commit that referenced this pull request Oct 2, 2017
Commit af6af08 introduced a build error in a Windows-only code path in
src/node_url.cc.

Fix it by making the code a little nicer in general: const-ify the
`input` parameter to `ToASCII()` and `ToUnicode()`.

PR-URL: #15724
Refs: #15615
Refs: #15723
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@sam-github sam-github deleted the url-copy-by-ref branch October 2, 2017 16:22
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.

PR-URL: #15615
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
Commit af6af08 introduced a build error in a Windows-only code path in
src/node_url.cc.

Fix it by making the code a little nicer in general: const-ify the
`input` parameter to `ToASCII()` and `ToUnicode()`.

PR-URL: #15724
Refs: #15615
Refs: #15723
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@MylesBorins MylesBorins mentioned this pull request Oct 3, 2017
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.

PR-URL: #15615
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
Commit af6af08 introduced a build error in a Windows-only code path in
src/node_url.cc.

Fix it by making the code a little nicer in general: const-ify the
`input` parameter to `ToASCII()` and `ToUnicode()`.

PR-URL: #15724
Refs: #15615
Refs: #15723
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 4, 2017
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.

PR-URL: nodejs/node#15615
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Oct 4, 2017
Commit af6af08 introduced a build error in a Windows-only code path in
src/node_url.cc.

Fix it by making the code a little nicer in general: const-ify the
`input` parameter to `ToASCII()` and `ToUnicode()`.

PR-URL: nodejs/node#15724
Refs: nodejs/node#15615
Refs: nodejs/node#15723
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
MylesBorins pushed a commit that referenced this pull request Oct 11, 2017
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.

PR-URL: #15615
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
MylesBorins pushed a commit that referenced this pull request Oct 11, 2017
Commit af6af08 introduced a build error in a Windows-only code path in
src/node_url.cc.

Fix it by making the code a little nicer in general: const-ify the
`input` parameter to `ToASCII()` and `ToUnicode()`.

PR-URL: #15724
Refs: #15615
Refs: #15723
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.