[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 9 18:14:09 PST 2025
kazutakahirata wrote:
@steakhal, I don't meant to delay the landing of this PR, but I just want to bring up the following. I'm wondering if your checker can catch repeated lookups within a loop like so:
```
for (int A : Vec)
Map[Key].push_back(A);
```
in a function that does not reference `Map` anywhere else. That is, statically, there is only one statement doing map lookups, but dynamically, the same lookup is repeated over and over. Thanks!
https://github.com/llvm/llvm-project/pull/125420
More information about the cfe-commits
mailing list