cmStrCat: Always reuse the largest allocation from an rvalue string
Extend commit 1cca051470 (cmStrCat(): allow any argument to be an rvalue
string, 2022-12-06, v3.26.0-rc1~215^2) to reuse the largest allocation
even if it is not big enough. It can be resized more efficiently than a
new allocation.
This was exposed by a slowdown in ctest's capture of test output since
refactoring in commit c8b93b9db6 (Source: Reduce string allocations,
2026-09-11, v4.5.0-rc1~177^2) assumed a large rvalue would be reused.
Fixes: #28298
1 file changed