Skip to content

Commit e9acbae

Browse files
committed
perf fix in fieldState.set()
1 parent fe9baf4 commit e9acbae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/demoinfocs/sendtables2/field_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (s *fieldState) set(fp *fieldPath, v interface{}) {
3838

3939
if y := len(x.state); y <= z {
4040
newCap := max(z+2, y*2)
41-
if newCap > cap(x.state) {
41+
if z+2 > cap(x.state) {
4242
newSlice := make([]interface{}, z+1, newCap)
4343
copy(newSlice, x.state)
4444
x.state = newSlice

0 commit comments

Comments
 (0)