Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2017-09-25 21:49:38 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2017-10-02 02:20:06 +0300
commitaf6af08482d2e7a4e20990bd67743e81a6be881c (patch)
tree6508d1922107a64a8d3c282d4e5c75c9b556dec0 /src/node_url.h
parent27d8202db54ce3eda6ff47703169e577476c9dd2 (diff)
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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_url.h b/src/node_url.h
index cb7bdca7f2c..503fb21e0d4 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;