fixed edge case for get many slices

This commit is contained in:
Andy Arthur
2022-02-21 15:08:57 -08:00
parent c4a13539ff
commit daa6256ede
2 changed files with 2 additions and 2 deletions

View File

@@ -202,7 +202,7 @@ func sliceManyFields(tuple Tuple, indexes []int, slices [][]byte) [][]byte {
}
// we don't have a "start" offset for the first field
if indexes[0] == 0 {
if len(indexes) > 0 && indexes[0] == 0 {
o := readUint16(offs[:2])
slices[0] = data[:o]
indexes = indexes[1:]

View File

@@ -49,7 +49,7 @@ func roundTripBytes(t *testing.T) {
}
func testTupleGetMany(t *testing.T) {
for n := 0; n < 100; n++ {
for n := 0; n < 1000; n++ {
fields := randomByteFields(t)
tup := NewTuple(testPool, fields...)