mirror of
https://github.com/nushell/nushell.git
synced 2024-11-25 01:43:47 +01: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
@ -322,5 +322,5 @@ export def repeat [
|
||||
return []
|
||||
}
|
||||
|
||||
..($n - 1) | each { $item }
|
||||
1..$n | each { $item }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user