Commit d0d6bc5
fix: eliminate unnecessary string copies in EmitDeref and GetOrMaterialize
- Change EmitDeref's `inner` parameter from `std::string` to `std::string_view`
to avoid copying a string that is only ever read via StrCat.
Update the three call sites accordingly (two std::move calls become plain refs).
- Change GetOrMaterialize's `materialize_fn` parameter from by-value to
`const std::function<...>&` to avoid copying the callable object on each call.
Agent-Logs-Url: https://github.com/Cpp2Rust/cpp2rust/sessions/a4a77a6f-20a8-49a8-98d1-507851373647
Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>1 parent c0195b8 commit d0d6bc5
2 files changed
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2321 | 2321 | | |
2322 | 2322 | | |
2323 | 2323 | | |
2324 | | - | |
| 2324 | + | |
2325 | 2325 | | |
2326 | 2326 | | |
2327 | 2327 | | |
| |||
2464 | 2464 | | |
2465 | 2465 | | |
2466 | 2466 | | |
2467 | | - | |
| 2467 | + | |
2468 | 2468 | | |
2469 | 2469 | | |
2470 | 2470 | | |
| |||
3561 | 3561 | | |
3562 | 3562 | | |
3563 | 3563 | | |
3564 | | - | |
| 3564 | + | |
3565 | 3565 | | |
3566 | 3566 | | |
3567 | 3567 | | |
3568 | 3568 | | |
3569 | 3569 | | |
3570 | 3570 | | |
3571 | | - | |
| 3571 | + | |
3572 | 3572 | | |
3573 | 3573 | | |
3574 | 3574 | | |
| |||
3605 | 3605 | | |
3606 | 3606 | | |
3607 | 3607 | | |
3608 | | - | |
3609 | | - | |
3610 | | - | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
3611 | 3611 | | |
3612 | 3612 | | |
3613 | 3613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
| 171 | + | |
| 172 | + | |
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
| |||
476 | 475 | | |
477 | 476 | | |
478 | 477 | | |
479 | | - | |
| 478 | + | |
480 | 479 | | |
481 | 480 | | |
482 | 481 | | |
| |||
0 commit comments