diff --git a/binary/slice.go b/binary/slice.go index 398dc7a..7a1dd4f 100644 --- a/binary/slice.go +++ b/binary/slice.go @@ -18,7 +18,7 @@ func reslice[T any](v []byte, length, rem int) []T { if rem > 0 { return append(s, make([]T, rem)...) } - return s[:length] + return s } func castSlice(c gltf.ComponentType, t gltf.AccessorType, count int, v []byte) any { @@ -27,7 +27,6 @@ func castSlice(c gltf.ComponentType, t gltf.AccessorType, count int, v []byte) a if count < l { l = count } else if count > l { - l = count rem = count - l } diff --git a/modeler/read_test.go b/modeler/read_test.go index 79f7de7..ae4e649 100644 --- a/modeler/read_test.go +++ b/modeler/read_test.go @@ -216,10 +216,10 @@ func TestReadAccessorAllocs(t *testing.T) { }) t.Run("2", func(t *testing.T) { buf := make([]byte, 24) - testFunc(t, buf, 1) - testFunc(t, buf, 1) - testFunc(t, buf, 1) - testFunc(t, buf, 1) + testFunc(t, buf, 3) + testFunc(t, buf, 3) + testFunc(t, buf, 3) + testFunc(t, buf, 3) }) t.Run("4", func(t *testing.T) { buf := make([]byte, 48)