File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -45,23 +45,15 @@ static inline unsigned *getHashTable(StringMapEntryBase **TheTable,
45
45
46
46
uint32_t StringMapImpl::hash (StringRef Key) { return xxh3_64bits (Key); }
47
47
48
- StringMapImpl::StringMapImpl (unsigned InitSize, unsigned itemSize) {
49
- ItemSize = itemSize;
50
-
48
+ StringMapImpl::StringMapImpl (unsigned InitSize, unsigned itemSize)
49
+ : ItemSize(itemSize) {
51
50
// If a size is specified, initialize the table with that many buckets.
52
51
if (InitSize) {
53
52
// The table will grow when the number of entries reach 3/4 of the number of
54
53
// buckets. To guarantee that "InitSize" number of entries can be inserted
55
54
// in the table without growing, we allocate just what is needed here.
56
55
init (getMinBucketToReserveForEntries (InitSize));
57
- return ;
58
56
}
59
-
60
- // Otherwise, initialize it with zero buckets to avoid the allocation.
61
- TheTable = nullptr ;
62
- NumBuckets = 0 ;
63
- NumItems = 0 ;
64
- NumTombstones = 0 ;
65
57
}
66
58
67
59
void StringMapImpl::init (unsigned InitSize) {
You can’t perform that action at this time.
0 commit comments