selector: disallow backward slicing

This commit is contained in:
Michael Muré
2024-10-23 11:31:41 +02:00
parent 52ae2eaf60
commit 7ad940844c

View File

@@ -344,9 +344,10 @@ func resolveSliceIndices(slice []int64, length int64) (start int64, end int64) {
end = length + slice[1] end = length + slice[1]
} }
// TODO: is backward iteration allowed? if start >= end {
// if yes, we need to return a +1 or -1 "step" // backward iteration is not allowed, shortcut to an empty result
// if no, we need to error start, end = 0, 0
}
return start, end return start, end
} }