forked from qt-creator/qt-creator
Libs: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I00d9f7c1634bbb62191470d58158e1fd150533c0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -89,14 +89,13 @@ static QList<Diff> decode(const QList<Diff> &diffList, const QStringList &lines)
|
||||
{
|
||||
QList<Diff> newDiffList;
|
||||
newDiffList.reserve(diffList.count());
|
||||
for (Diff diff : diffList) {
|
||||
for (const Diff &diff : diffList) {
|
||||
QString text;
|
||||
for (QChar c : diff.text) {
|
||||
const int idx = static_cast<ushort>(c.unicode());
|
||||
text += lines.value(idx);
|
||||
}
|
||||
diff.text = text;
|
||||
newDiffList.append(diff);
|
||||
newDiffList.append({diff.command, text});
|
||||
}
|
||||
return newDiffList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user