diff options
| author | Adrian Vogelsgesang <avogelsgesang@tableau.com> | 2021-10-27 11:49:00 -0700 |
|---|---|---|
| committer | Whisperity <whisperity@gmail.com> | 2022-01-24 12:57:18 +0100 |
| commit | 3696c70e67d9b9e54307ef25077bae7a6f76636e (patch) | |
| tree | 7b51f2e955146c810f5af846d8170998167f6862 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h | |
| parent | 3e50593b18840ab4508a25d0f761afb65535a38d (diff) | |
| download | llvm-3696c70e67d9b9e54307ef25077bae7a6f76636e.zip llvm-3696c70e67d9b9e54307ef25077bae7a6f76636e.tar.gz llvm-3696c70e67d9b9e54307ef25077bae7a6f76636e.tar.bz2 | |
[clang-tidy] Add `readability-container-contains` check
This commit introduces a new check `readability-container-contains` which finds
usages of `container.count()` and `container.find() != container.end()` and
instead recommends the `container.contains()` method introduced in C++20.
For containers which permit multiple entries per key (`multimap`, `multiset`,
...), `contains` is more efficient than `count` because `count` has to do
unnecessary additional work.
While this this performance difference does not exist for containers with only
a single entry per key (`map`, `unordered_map`, ...), `contains` still conveys
the intent better.
Reviewed By: xazax.hun, whisperity
Differential Revision: http://reviews.llvm.org/D112646
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h')
0 files changed, 0 insertions, 0 deletions
