Skip to content

Commit 8b360ec

Browse files
dgryskideadprogram
authored andcommitted
src/runtime: remove extra if check in hashmap set logic
1 parent 9365454 commit 8b360ec

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/runtime/hashmap.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,6 @@ func hashmapLenUnsafePointer(p unsafe.Pointer) int {
153153
func hashmapSet(m *hashmap, key unsafe.Pointer, value unsafe.Pointer, hash uint32) {
154154
tophash := hashmapTopHash(hash)
155155

156-
if m.buckets == nil {
157-
// No bucket was allocated yet, do so now.
158-
m.buckets = unsafe.Pointer(hashmapInsertIntoNewBucket(m, key, value, tophash))
159-
return
160-
}
161-
162156
if hashmapShouldGrow(m) {
163157
hashmapGrow(m)
164158
}

0 commit comments

Comments
 (0)