From 609c3b7cdc4f633a49424de667ba332e483ffb46 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 8 Apr 2020 11:55:38 -0400 Subject: cmComputeLinkInformation: reserve space in built-up string This should avoid any reallocations that would occur in this function. --- Source/cmComputeLinkInformation.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 4d297e8..d8a6204 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -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 == '.') { -- cgit v0.12