Replace most trivial uses of slice() with faster list_head() and list_tail()

This commit is contained in:
Garth Minette
2021-03-25 00:23:36 -07:00
parent e9e3616861
commit d7cb503ffc
10 changed files with 112 additions and 51 deletions

View File

@@ -544,9 +544,8 @@ function _lcm(a,b) =
// Computes lcm for a list of values
function _lcmlist(a) =
len(a)==1
? a[0]
: _lcmlist(concat(slice(a,0,len(a)-2),[lcm(a[len(a)-2],a[len(a)-1])]));
len(a)==1 ? a[0] :
_lcmlist(concat(lcm(a[0],a[1]),list_tail(a,2)));
// Function: lcm()