remove redunant list.sublist check

This commit is contained in:
Brendan Hansknecht 2023-11-20 11:23:13 -08:00
parent 223efe4a2d
commit 26afbbe8f6
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -1123,9 +1123,6 @@ findLastIndex = \list, matches ->
## Some languages have a function called **`slice`** which works similarly to this. ## Some languages have a function called **`slice`** which works similarly to this.
sublist : List elem, { start : Nat, len : Nat } -> List elem sublist : List elem, { start : Nat, len : Nat } -> List elem
sublist = \list, config -> sublist = \list, config ->
if config.len == 0 then
[]
else
sublistLowlevel list config.start config.len sublistLowlevel list config.start config.len
## low-level slicing operation that does no bounds checking ## low-level slicing operation that does no bounds checking