mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 16:33:40 +00:00
src/runtime: remove extra if check in hashmap set logic
This commit is contained in:
@@ -153,12 +153,6 @@ func hashmapLenUnsafePointer(p unsafe.Pointer) int {
|
|||||||
func hashmapSet(m *hashmap, key unsafe.Pointer, value unsafe.Pointer, hash uint32) {
|
func hashmapSet(m *hashmap, key unsafe.Pointer, value unsafe.Pointer, hash uint32) {
|
||||||
tophash := hashmapTopHash(hash)
|
tophash := hashmapTopHash(hash)
|
||||||
|
|
||||||
if m.buckets == nil {
|
|
||||||
// No bucket was allocated yet, do so now.
|
|
||||||
m.buckets = unsafe.Pointer(hashmapInsertIntoNewBucket(m, key, value, tophash))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if hashmapShouldGrow(m) {
|
if hashmapShouldGrow(m) {
|
||||||
hashmapGrow(m)
|
hashmapGrow(m)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user