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,
4545
4646uint32_t StringMapImpl::hash (StringRef Key) { return xxh3_64bits (Key); }
4747
48- StringMapImpl::StringMapImpl (unsigned InitSize, unsigned itemSize) {
49- ItemSize = itemSize;
50-
48+ StringMapImpl::StringMapImpl (unsigned InitSize, unsigned itemSize)
49+ : ItemSize(itemSize) {
5150 // If a size is specified, initialize the table with that many buckets.
5251 if (InitSize) {
5352 // The table will grow when the number of entries reach 3/4 of the number of
5453 // buckets. To guarantee that "InitSize" number of entries can be inserted
5554 // in the table without growing, we allocate just what is needed here.
5655 init (getMinBucketToReserveForEntries (InitSize));
57- return ;
5856 }
59-
60- // Otherwise, initialize it with zero buckets to avoid the allocation.
61- TheTable = nullptr ;
62- NumBuckets = 0 ;
63- NumItems = 0 ;
64- NumTombstones = 0 ;
6557}
6658
6759void StringMapImpl::init (unsigned InitSize) {
You can’t perform that action at this time.
0 commit comments