mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-26 20:57:15 +00:00
make DenseMap::clear() early exit if there is nothing to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0a9ad97b35
commit
32859c71d6
@ -93,6 +93,8 @@ public:
|
||||
void resize(size_t Size) { grow(Size); }
|
||||
|
||||
void clear() {
|
||||
if (NumEntries == 0 && NumTombstones == 0) return;
|
||||
|
||||
// If the capacity of the array is huge, and the # elements used is small,
|
||||
// shrink the array.
|
||||
if (NumEntries * 4 < NumBuckets && NumBuckets > 64) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user