diff --git a/lib/token.cpp b/lib/token.cpp index fafaba9ced3..88597b00af4 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -2099,10 +2099,10 @@ static void mergeAdjacent(std::list& values) static void removeOverlaps(std::list& values) { - for (ValueFlow::Value& x : values) { + for (const ValueFlow::Value& x : values) { if (x.isNonValue()) continue; - values.remove_if([&](ValueFlow::Value& y) { + values.remove_if([&](const ValueFlow::Value& y) { if (y.isNonValue()) return false; if (&x == &y)