lib.lists.take: rewrite to not call sublist

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