lib.lists.drop: rewrite to not call sublist

This commit is contained in:
Eman Resu
2026-06-24 18:29:20 -04:00
parent 097288cc6f
commit 3621649b19
+6 -1
View File
@@ -1581,7 +1581,12 @@ rec {
:::
*/
drop = count: list: sublist count (length list) list;
drop =
count: list:
let
len = length list;
in
genList (n: elemAt list (n + count)) (if count > len then 0 else len - count);
/**
Remove the last (at most) N elements of a list.