From 1d9ec0469373fa22c34cfec1ab25285c7796418a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 27 Sep 2018 21:52:18 +0200 Subject: [PATCH] url: use foreach-style C++ loop PR-URL: https://github.com/nodejs/node/pull/23138 Reviewed-By: Refael Ackermann Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani --- src/node_url.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node_url.h b/src/node_url.h index 5e61aee4efbd5a..055393d22e0f19 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -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; }