aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringMap.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-07-19 09:15:48 +0900
committerGitHub <noreply@github.com>2025-07-19 09:15:48 +0900
commit2f38ced51b7c560dcb6d01180efe5ab22bbe004f (patch)
tree87f3fe32c51eb555416aaea6116c255752af25c9 /llvm/lib/Support/StringMap.cpp
parenta5d6fa68e399dee9eb56f2671670085b26c06b4a (diff)
downloadllvm-2f38ced51b7c560dcb6d01180efe5ab22bbe004f.zip
llvm-2f38ced51b7c560dcb6d01180efe5ab22bbe004f.tar.gz
llvm-2f38ced51b7c560dcb6d01180efe5ab22bbe004f.tar.bz2
StringMap: Remove redundant member init in constructor (#149491)
These are already zeroinitialized in the field definitions.
Diffstat (limited to 'llvm/lib/Support/StringMap.cpp')
-rw-r--r--llvm/lib/Support/StringMap.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Support/StringMap.cpp b/llvm/lib/Support/StringMap.cpp
index 432e1fc..3432dc1 100644
--- a/llvm/lib/Support/StringMap.cpp
+++ b/llvm/lib/Support/StringMap.cpp
@@ -45,23 +45,15 @@ static inline unsigned *getHashTable(StringMapEntryBase **TheTable,
uint32_t StringMapImpl::hash(StringRef Key) { return xxh3_64bits(Key); }
-StringMapImpl::StringMapImpl(unsigned InitSize, unsigned itemSize) {
- ItemSize = itemSize;
-
+StringMapImpl::StringMapImpl(unsigned InitSize, unsigned itemSize)
+ : ItemSize(itemSize) {
// If a size is specified, initialize the table with that many buckets.
if (InitSize) {
// The table will grow when the number of entries reach 3/4 of the number of
// buckets. To guarantee that "InitSize" number of entries can be inserted
// in the table without growing, we allocate just what is needed here.
init(getMinBucketToReserveForEntries(InitSize));
- return;
}
-
- // Otherwise, initialize it with zero buckets to avoid the allocation.
- TheTable = nullptr;
- NumBuckets = 0;
- NumItems = 0;
- NumTombstones = 0;
}
void StringMapImpl::init(unsigned InitSize) {