Issue |
80853
|
Summary |
Create performance-avoid-reserve-in-loop
|
Labels |
clang-tidy,
check-request
|
Assignees |
|
Reporter |
PiotrZSL
|
I'm adding this here so, i wouldn't forget.
Background: https://www.dominikgrabiec.com/c++/2023/10/31/cpp_antipattern_using_reserve_in_loop.html)/c++/2023/10/31/cpp_antipattern_using_reserve_in_loop.html
```
Container container;
for (const auto& entry : entries)
{
container.reserve(container.size() + entry.ItemCount());
entry.AppendItems(container);
}
```
Check should detect calls to reserve in loop on object that is outside of the loop.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs