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:
Tobias Nießen 2018-09-27 21:52:18 +02:00 committed by Anna Henningsen
parent 47a0a0b503
commit 1d9ec04693
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -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;
}