https://github.com/ldionne approved this pull request. LGTM with request to add a new comment. And please run the benchmarks on this one since we're modifying `string`. Otherwise, nice refactoring! https://github.com/llvm/llvm-project/pull/162631