desktop: avoid dangling reference

Let the compiler figure out the correct type...

Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-12-17 10:33:17 -08:00
parent bded5f3e5f
commit fdffb870e5

View file

@ -280,7 +280,7 @@ void TemplateLayout::parser_for(QList<token> tokenList, int from, int to, QTextS
const T *old = act;
int i = 1; // Loop iterators start at one
int olditerator = state.forloopiterator;
for (const T &item: data) {
for (auto &item: data) {
act = &item;
state.forloopiterator = i++;
parser(tokenList, from, to, out, state);