Commit 5165270
committed
Auto merge of #8641 - weihanglo:fix/remove-alloc, r=Eh2406
fix: remove unnecessary allocations
Remove unnecessary `str::to_string` and `str::replace` allocations by using iterators. This PR is almost identical to #8622 except it does not skip the generated header.
Sorry that I did not profile the changes by myself. Seems that valgrind does not support macOS 10.15.6, I have not idea how to profile cargo subcommand. It would be great for an instruction to run a memory profiling for Rust program on macOS.1 file changed
+3
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 177 | | |
183 | 178 | | |
184 | 179 | | |
185 | 180 | | |
186 | 181 | | |
187 | | - | |
| 182 | + | |
188 | 183 | | |
189 | | - | |
| 184 | + | |
190 | 185 | | |
191 | 186 | | |
192 | 187 | | |
193 | 188 | | |
194 | 189 | | |
195 | 190 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 191 | + | |
206 | 192 | | |
207 | 193 | | |
208 | 194 | | |
| |||
0 commit comments