Codegen: Avoid useless zero subtraction in rest arguments #12188
Labels
Fixed
A PR has been merged for this issue
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Currenty the function like this:
is transpiled into
You may notice that zero subtraction in the
args[_i-0]
part is useless.My proposal is to drop it and use just
args[_i]
in cases when the function signature consists only of spread.This small change won't affect the generated code behavior, but would make it slightly more readable and compact.
You can preview the results here, and here's the proposed change
The text was updated successfully, but these errors were encountered: