Skip to content

Commit

Permalink
std::encoding::json: minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 20, 2024
1 parent cee516e commit a3ad9f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions std/encoding/json/buffer.jule
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn growSlice(b: []byte, n: int): []byte {
if c < cap(b)<<1 {
c = cap(b) << 1
}
mut b2 := append([]byte(nil), make([]byte, c)...)
mut b2 := make([]byte, len(b), c)
copy(b2, b)
ret b2[:len(b)]
ret b2
}

0 comments on commit a3ad9f8

Please sign in to comment.