Skip to content

Commit 14e00f8

Browse files
committed
Specify size when making map
This doesn't really improve much with the sizes we normally see. Maybe it would help more with larger maps.
1 parent da0ebb9 commit 14e00f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

decoder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func (d *decoder) decodeMap(
456456
depth int,
457457
) (uint, error) {
458458
if result.IsNil() {
459-
result.Set(reflect.MakeMap(result.Type()))
459+
result.Set(reflect.MakeMapWithSize(result.Type(), int(size)))
460460
}
461461

462462
for i := uint(0); i < size; i++ {

0 commit comments

Comments
 (0)