mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-05 01:52:46 +00:00
fix GrowJust() not returning slice of same length
This commit is contained in:
parent
3431474b2e
commit
7b26b62a04
|
@ -29,7 +29,7 @@
|
|||
// 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…
Reference in a new issue