diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2017-09-25 11:49:38 -0700 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2017-10-01 20:20:06 -0300 |
commit | af6af08482d2e7a4e20990bd67743e81a6be881c (patch) | |
tree | 6508d1922107a64a8d3c282d4e5c75c9b556dec0 /src/node_url.h | |
parent | 27d8202db54ce3eda6ff47703169e577476c9dd2 (diff) | |
download | node-new-af6af08482d2e7a4e20990bd67743e81a6be881c.tar.gz |
url: const-ify APIs, and pass URL by ref
Fixes warnings by Coverity Scan of inefficiences when passing by value
instead of passing by const reference.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/node_url.h')
-rw-r--r-- | src/node_url.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_url.h b/src/node_url.h index cb7bdca7f2..503fb21e0d 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -154,7 +154,7 @@ class URL { return context_.fragment; } - std::string path() { + std::string path() const { std::string ret; for (auto i = context_.path.begin(); i != context_.path.end(); i++) { ret += '/'; @@ -165,7 +165,7 @@ class URL { // Get the path of the file: URL in a format consumable by native file system // APIs. Returns an empty string if something went wrong. - std::string ToFilePath(); + std::string ToFilePath() const; const Local<Value> ToObject(Environment* env) const; |