programmemory.cpp: avoid repeated iteration over values in `Executor::executeImpl()`
-D__GNUC__ --check-level=exhaustive ../lib/utils.cpp
Clang 17 722,148,610 -> 709,134,445
GCC 14 763,758,550 -> 748,797,242
The example from https://trac.cppcheck.net/ticket/10765#comment:4:
Clang 17 3,745,218,263 -> 3,683,364,401
GCC 14 4,007,836,001 -> 3,916,329,290
@pfultz2 Is this a valid change?
The previous code had priority which value type have been taken which is no longer the case in the new code. Tests are still passing and I also added an else to break into and that was never hit so it seems like this change should be fine.
Tokens can have more than one known value, but its not very common.
Tokens can have more than one known value, but its not very common.
So the priority of fetching the type is important?
What is such a case? We should add a unit test for that (if there isn't one already).
Requires #7181 to be merged first.
There are multiple known values. TestAutoVariables::danglingLifetimeContainer fails when I assert on that. It has known ITERATOR_START and CONTAINER_SIZE.