From cc2732d5c3c1872f4fd3ec0a80de1662e2fae4bc Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 9 Feb 2020 19:30:47 -0800 Subject: [PATCH] base: Use a const auto & in a range based for loop. clang 11 complains otherwise which breaks the build, and this way is less verbose and more efficient since it doesn't require copying a vector of strings for each element of the loop. Change-Id: I005fa5fdf19ddba2114e98413e3609b0a91c1ec5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25226 Reviewed-by: Giacomo Travaglini Reviewed-by: Jason Lowe-Power Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/base/match.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/match.cc b/src/base/match.cc index 7c2c0cf58..bfbdbf0b1 100644 --- a/src/base/match.cc +++ b/src/base/match.cc @@ -109,7 +109,7 @@ std::vector > ObjectMatch::getExpressions() { std::vector > to_return; - for (const std::vector expression : tokens) { + for (const auto &expression: tokens) { std::vector to_add; to_add.insert(to_add.end(), expression.begin(), expression.end()); to_return.push_back(to_add); -- 2.30.2