forked from extern/nushell
Optimize use of range in std repeat
(#10353)
# Description By using a `from: 1` the additional subexpression for `to` becomes unnecessary. Saves additional evaluation steps if `std repeat` is frequently used with low `n` # User-Facing Changes None # Tests + Formatting (-)
This commit is contained in:
parent
73d3708006
commit
48c94c75fc
@ -322,5 +322,5 @@ export def repeat [
|
||||
return []
|
||||
}
|
||||
|
||||
..($n - 1) | each { $item }
|
||||
1..$n | each { $item }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user