diff --git a/lib/suppressions.cpp b/lib/suppressions.cpp index 18165ab32..6ec2666dd 100644 --- a/lib/suppressions.cpp +++ b/lib/suppressions.cpp @@ -441,7 +441,7 @@ std::list Suppressions::getUnmatchedGlobalSuppression return result; } -std::list Suppressions::getSuppressions() const +const std::list &Suppressions::getSuppressions() const { return mSuppressions; } diff --git a/lib/suppressions.h b/lib/suppressions.h index e066b63a3..4dc08945f 100644 --- a/lib/suppressions.h +++ b/lib/suppressions.h @@ -201,7 +201,7 @@ public: * @brief Returns list of all suppressions. * @return list of suppressions */ - std::list getSuppressions() const; + const std::list &getSuppressions() const; private: /** @brief List of error which the user doesn't want to see. */ diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 4a6e14823..8a454a340 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -4193,8 +4193,8 @@ void Scope::addVariable(const Token *token_, const Token *start_, const Token *e void Scope::getVariableList(const Settings* settings) { if (!bodyStartList.empty()) { - for (const Token *bodyStart: bodyStartList) - getVariableList(settings, bodyStart->next()); + for (const Token *bs: bodyStartList) + getVariableList(settings, bs->next()); } // global scope