mirror of
https://github.com/nushell/nushell
synced 2024-12-27 21:43:09 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -322,5 +322,5 @@ export def repeat [
|
|||
return []
|
||||
}
|
||||
|
||||
..($n - 1) | each { $item }
|
||||
1..$n | each { $item }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue