Commit 1f59e31
committed
perf(utils): pre-size FilterArgs result slice (was unpresized regrow per CLI run)
FilterArgs ran on every Cli.Run with an unpresized 'var clean []string' +
append — geometric regrow. Pre-sized to len(args) (almost all args survive
the filter); returns nil when empty to stay byte-identical. 1 alloc, no regrow.
Co-Authored-By: Virgil <virgil@lethean.io>1 parent 8459346 commit 1f59e31
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
| |||
0 commit comments