url: use foreach-style C++ loop
PR-URL: https://github.com/nodejs/node/pull/23138 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
parent
47a0a0b503
commit
1d9ec04693
@ -159,9 +159,8 @@ class URL {
|
||||
|
||||
std::string path() const {
|
||||
std::string ret;
|
||||
for (auto i = context_.path.begin(); i != context_.path.end(); i++) {
|
||||
ret += '/';
|
||||
ret += *i;
|
||||
for (const std::string& element : context_.path) {
|
||||
ret += '/' + element;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user