Skip to content

Commit 885c3d2

Browse files
committed
refactor: Don't resize on edge case
1 parent 05c0f12 commit 885c3d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stringbuilder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (s *StringBuilder) resize(words ...string) {
7979
allWordLength += len(word)
8080
}
8181
newLen := s.position + allWordLength
82-
if newLen >= cap(s.data) {
82+
if newLen > cap(s.data) {
8383
s.grow(newLen)
8484
}
8585
}

0 commit comments

Comments
 (0)