selector: disallow backward slicing
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user