Skip to content

Commit fb4eae9

Browse files
author
Daniel Marjamäki
committed
useStlAlgorithm
1 parent 9475723 commit fb4eae9

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/errorlogger.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ ErrorMessage::ErrorMessage(ErrorPath errorPath, const TokenList *tokenList, Seve
163163

164164
setmsg(msg);
165165

166-
std::list<const Token*> callstack;
167-
for (const ErrorPathItem& e: errorPath) {
168-
callstack.push_back(e.first);
169-
}
170-
calculateWarningHash(callstack);
166+
std::list<const Token*> tokens;
167+
std::transform(errorPath.cbegin(), errorPath.cend(), std::back_inserter(tokens), [](const ErrorPathItem& e) { return e.first; });
168+
calculateWarningHash(tokens);
171169
}
172170

173171
// TODO: improve errorhandling?

0 commit comments

Comments
 (0)