Skip to content

Commit

Permalink
Fix incorrect reallocation (#58)
Browse files Browse the repository at this point in the history
Regression from #55
  • Loading branch information
klauspost authored Feb 24, 2022
1 parent 9743702 commit e806b44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse_json_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
func (pj *internalParsedJson) initialize(size int) {
// Estimate the tape size to be about 15% of the length of the JSON message
avgTapeSize := size * 15 / 100
if cap(pj.Tape) <= avgTapeSize {
if cap(pj.Tape) < avgTapeSize {
pj.Tape = make([]uint64, 0, avgTapeSize)
}
pj.Tape = pj.Tape[:0]
Expand Down

0 comments on commit e806b44

Please sign in to comment.