cmComputeLinkInformation: reserve space in built-up string

This should avoid any reallocations that would occur in this function.
This commit is contained in:
Ben Boeckel
2020-04-08 11:55:38 -04:00
parent 89207abf1f
commit 609c3b7cdc

View File

@@ -998,6 +998,7 @@ std::string cmComputeLinkInformation::CreateExtensionRegex(
std::string cmComputeLinkInformation::NoCaseExpression(const char* str)
{
std::string ret;
ret.reserve(strlen(str) * 4);
const char* s = str;
while (*s) {
if (*s == '.') {