From 2578c3d2acbcb4efdec5688ff771b97516b93b53 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 29 Mar 2022 15:25:54 +0200 Subject: [PATCH] Base: [skip ci] optimize iteration over container with parameter group elements --- src/Base/ParameterPy.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Base/ParameterPy.cpp b/src/Base/ParameterPy.cpp index 2664ce5cb5..de7f17c2a1 100644 --- a/src/Base/ParameterPy.cpp +++ b/src/Base/ParameterPy.cpp @@ -299,7 +299,7 @@ Py::Object ParameterGrpPy::getGroups(const Py::Tuple& args) // get the Handle of the wanted group std::vector > handle = _cParamGrp->GetGroups(); Py::List list; - for (auto it : handle) { + for (const auto& it : handle) { list.append(Py::String(it->GetGroupName())); } @@ -335,7 +335,7 @@ Py::Object ParameterGrpPy::getBools(const Py::Tuple& args) std::vector > map = _cParamGrp->GetBoolMap(filter); Py::List list; - for (auto it : map) { + for (const auto& it : map) { list.append(Py::String(it.first)); } @@ -370,7 +370,7 @@ Py::Object ParameterGrpPy::getInts(const Py::Tuple& args) std::vector > map = _cParamGrp->GetIntMap(filter); Py::List list; - for (auto it : map) { + for (const auto& it : map) { list.append(Py::String(it.first)); } @@ -405,7 +405,7 @@ Py::Object ParameterGrpPy::getUnsigneds(const Py::Tuple& args) std::vector > map = _cParamGrp->GetUnsignedMap(filter); Py::List list; - for (auto it : map) { + for (const auto& it : map) { list.append(Py::String(it.first)); } @@ -441,7 +441,7 @@ Py::Object ParameterGrpPy::getFloats(const Py::Tuple& args) std::vector > map = _cParamGrp->GetFloatMap(filter); Py::List list; - for (auto it : map) { + for (const auto& it : map) { list.append(Py::String(it.first)); } @@ -477,7 +477,7 @@ Py::Object ParameterGrpPy::getStrings(const Py::Tuple& args) std::vector > map = _cParamGrp->GetASCIIMap(filter); Py::List list; - for (auto it : map) { + for (const auto& it : map) { list.append(Py::String(it.first)); }