Skip to content

Commit

Permalink
Merge pull request #3830 from jimidle/feature/collection
Browse files Browse the repository at this point in the history
feat: Reduce initial memory allocations for collections
  • Loading branch information
parrt authored Aug 23, 2022
2 parents 36e5469 + 0867505 commit 2339308
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/Go/antlr/jcollect.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewJStore[T any, C Comparator[T]](comparator Comparator[T]) *JStore[T, C] {
}

s := &JStore[T, C]{
store: make(map[int][]T),
store: make(map[int][]T, 1),
comparator: comparator,
}
return s
Expand Down Expand Up @@ -138,7 +138,7 @@ type JMap[K, V any, C Comparator[K]] struct {

func NewJMap[K, V any, C Comparator[K]](comparator Comparator[K]) *JMap[K, V, C] {
return &JMap[K, V, C]{
store: make(map[int][]*entry[K, V]),
store: make(map[int][]*entry[K, V], 1),
comparator: comparator,
}
}
Expand Down

0 comments on commit 2339308

Please sign in to comment.