Refactor: fix member shadowing, return by const ref (#3407)

This commit is contained in:
chrchr-github 2021-08-21 22:00:45 +02:00 committed by GitHub
parent a0c37ceba2
commit ee4d90b4fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -441,7 +441,7 @@ std::list<Suppressions::Suppression> Suppressions::getUnmatchedGlobalSuppression
return result;
}
std::list<Suppressions::Suppression> Suppressions::getSuppressions() const
const std::list<Suppressions::Suppression> &Suppressions::getSuppressions() const
{
return mSuppressions;
}

View File

@ -201,7 +201,7 @@ public:
* @brief Returns list of all suppressions.
* @return list of suppressions
*/
std::list<Suppression> getSuppressions() const;
const std::list<Suppression> &getSuppressions() const;
private:
/** @brief List of error which the user doesn't want to see. */

View File

@ -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