summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-11-17 08:00:09 -0800
committerGitHub <noreply@github.com>2025-11-17 08:00:09 -0800
commit3c54972def503440e351a0ec6553c8fed884fe13 (patch)
tree2adeaa77d037b57bbbe39441ebb00eb1987df9d0 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parentdcf8cd9c5b7cf15a07850484c6bb50516c4faacd (diff)
[ADT] Remove DenseMap::init (NFC) (#168322)
This patch removes DenseMap::init and SmallDenseMap::init by inlining them into their call sites and simplifying them. init() is defined as: void init(unsigned InitNumEntries) { auto InitBuckets = BaseT::getMinBucketToReserveForEntries(InitNumEntries); this->initWithExactBucketCount(InitBuckets); } - Constuctors: Now that we have constructors that allocate the exact number of buckets (as opposed to the number of key/value pairs), init() does too much. Once we convert the number of key/value pairs to the number of buckets, we can call the constructors that take the exact number of buckets. - init(0) in the move assignment operators simplifies down to: initWithExactBucketCount(0) - shrink_and_clear() computes the number of buckets to have after the clear operation. As such, we should call initWithExactBucketCount, not init. Otherwise, we would end up adding "load factor padding" on top of NewNumBuckets: NextPowerOf2(NewNumBuckets * 4 / 3 + 1) All in all, init() doesn't bring any value in the current setup. This patch is part of the effort outlined in #168255.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions