Commit 8985f1f
authored
Rollup merge of #155847 - DaniPopes:string-push-len, r=jhpratt
Don't reload length in String::push
Same as in `Vec::push_mut`, we get `.len()` once at the start since it won't change in the `reserve()` call.
Saves reloading the length after the allocation: https://godbolt.org/z/W3G165Gd71 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1420 | 1420 | | |
1421 | 1421 | | |
1422 | 1422 | | |
1423 | | - | |
| 1423 | + | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
| |||
0 commit comments