mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 15:26:15 -06:00
fix GrowJust() not returning slice of same length
This commit is contained in:
parent
3431474b2e
commit
7b26b62a04
1 changed files with 1 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ import (
|
|||
// may allocate more than necessary extra size.
|
||||
func GrowJust[T any](in []T, size int) []T {
|
||||
if cap(in)-len(in) < size {
|
||||
in2 := make([]T, len(in)+size)
|
||||
in2 := make([]T, len(in), len(in)+size)
|
||||
_ = copy(in2, in)
|
||||
in = in2
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue