Skip to content

Commit

Permalink
check size parameter if positive value in new function
Browse files Browse the repository at this point in the history
  • Loading branch information
semihbkgr committed Dec 18, 2023
1 parent d41ce81 commit 249e2f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type (
func New[K hashable, V any](size ...uintptr) *Map[K, V] {
m := &Map[K, V]{listHead: newListHead[K, V]()}
m.numItems.Store(0)
if len(size) > 0 {
if len(size) > 0 && size[0] > 0 {
m.allocate(size[0])
} else {
m.allocate(defaultSize)
Expand Down

0 comments on commit 249e2f6

Please sign in to comment.