2 Dec
2019
2 Dec
'19
6:24 p.m.
Zach Laine wrote:
Ok, I tried this myself on Quickbench:
I tried to fix that to add the null terminator, but as a result both push_backs were entirely optimized away. http://quick-bench.com/DtPR9Yov1TSzUFeYRx0ipVvUYBk The Append case is how I think this code should be written. Character by character loops are only useful as a worst-case estimate; if there's a performance problem there, you'd rewrite the loop to not push_back characters one by one, not try to make it go faster.