Skip to content

Commit

Permalink
remove redunant list.sublist check
Browse files Browse the repository at this point in the history
  • Loading branch information
bhansconnect committed Nov 20, 2023
1 parent 3dc3a3a commit c2b0980
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/compiler/builtins/roc/List.roc
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,7 @@ findLastIndex = \list, matches ->
## Some languages have a function called **`slice`** which works similarly to this.
sublist : List elem, { start : Nat, len : Nat } -> List elem
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
sublistLowlevel : List elem, Nat, Nat -> List elem
Expand Down

0 comments on commit c2b0980

Please sign in to comment.