From c7e3ab12b0a124845e938bc73ca715d51efd6ec4 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann <sebholt@xwmw.org> Date: Sun, 14 Apr 2019 17:48:45 +0200 Subject: [PATCH] SystemTools: Optimize range loop in FindProgram method --- SystemTools.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index 0d034533..4a42addd 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -2959,10 +2959,9 @@ std::string SystemTools::FindProgram(const std::vector<std::string>& names, const std::vector<std::string>& path, bool noSystemPath) { - for (std::vector<std::string>::const_iterator it = names.begin(); - it != names.end(); ++it) { + for (std::string const& name : names) { // Try to find the program. - std::string result = SystemTools::FindProgram(*it, path, noSystemPath); + std::string result = SystemTools::FindProgram(name, path, noSystemPath); if (!result.empty()) { return result; } -- GitLab