Commit e968eec
linq_fold: PR F3 R1 — drop redundant clone_type(elemType) (Copilot #1)
Copilot flagged emit_decs_early_exit's `retType = clone_type(elemType)`
as a double-clone since `elemType` is already `clone_type(chainInfo.finalType)`.
Same pattern appeared in 3 emit_decs_walk_lane arms (last / single /
single_or_default).
Both `elemType` and `retType` get qmacro-spliced (apply_template clones
its inputs internally), so the explicit clone is wasted work. Sharing the
elemType pointer between the var-decl splice and the invoke retType splice
is safe — each splice clones independently at emit time.
AST byte-identical to pre-fix dump on the same 6-chain baseline.
tests/linq green (1689/1689).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 411fac6 commit e968eec
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5423 | 5423 | | |
5424 | 5424 | | |
5425 | 5425 | | |
5426 | | - | |
| 5426 | + | |
5427 | 5427 | | |
5428 | 5428 | | |
5429 | 5429 | | |
| |||
5680 | 5680 | | |
5681 | 5681 | | |
5682 | 5682 | | |
5683 | | - | |
| 5683 | + | |
5684 | 5684 | | |
5685 | 5685 | | |
5686 | 5686 | | |
| |||
5708 | 5708 | | |
5709 | 5709 | | |
5710 | 5710 | | |
5711 | | - | |
| 5711 | + | |
5712 | 5712 | | |
5713 | 5713 | | |
5714 | 5714 | | |
| |||
5726 | 5726 | | |
5727 | 5727 | | |
5728 | 5728 | | |
5729 | | - | |
| 5729 | + | |
5730 | 5730 | | |
5731 | 5731 | | |
5732 | 5732 | | |
| |||
0 commit comments