diff options
| author | João M. Bezerra <marcospb19@hotmail.com> | 2023-06-27 01:05:48 -0300 |
|---|---|---|
| committer | João M. Bezerra <marcospb19@hotmail.com> | 2023-06-27 18:45:47 -0300 |
| commit | 11f35d60163c659e2960f2749f7db732d3fc9000 (patch) | |
| tree | cdfd9239531951ed763963d8dda2d564352c27dd /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 27e10c5292eee22abef69aed7144f80bdea00603 (diff) | |
| download | rust-11f35d60163c659e2960f2749f7db732d3fc9000.tar.gz rust-11f35d60163c659e2960f2749f7db732d3fc9000.zip | |
std: remove an allocation in `Path::with_extension`
`Path::with_extension` used to reallocate (and copy) paths twice per call, now it does it once, by checking the size of the previous and new extensions it's possible to call `PathBuf::with_capacity` and pass the exact capacity it takes. Also reduce the memory consumption of the path returned from `Path::with_extension` by using exact capacity instead of using amortized exponential growth.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
