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:
Stefan Holderbach 2023-09-13 14:50:09 +02:00 committed by GitHub
parent 73d3708006
commit 48c94c75fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,5 +322,5 @@ export def repeat [
return [] return []
} }
..($n - 1) | each { $item } 1..$n | each { $item }
} }