From cc7ee77d9031853580eeecd8c80ca195a8ae9bd6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:49:42 -0800 Subject: [vcpkg] The static keyword at member function scope is not once-per-instance, it's once-per-function --- toolsrc/src/BuildInfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/src/BuildInfo.cpp') diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 1f802869f..3fc56efc0 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -16,13 +16,13 @@ namespace vcpkg const std::regex& BuildType::crt_regex() const { - static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } const std::string& BuildType::toString() const { - static const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); return s; } @@ -153,7 +153,7 @@ namespace vcpkg const std::regex& OutdatedDynamicCrt::crt_regex() const { - static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } -- cgit v1.2.3 From 692d95c865f271d0805a60fff63fb319c1985ad3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:51:12 -0800 Subject: [vcpkg] Do not return references to locals --- toolsrc/src/BuildInfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/src/BuildInfo.cpp') diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 3fc56efc0..8d46a0dba 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -14,13 +14,13 @@ namespace vcpkg return this->m_linkage; } - const std::regex& BuildType::crt_regex() const + const std::regex BuildType::crt_regex() const { const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } - const std::string& BuildType::toString() const + const std::string BuildType::toString() const { const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); return s; @@ -151,7 +151,7 @@ namespace vcpkg const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - const std::regex& OutdatedDynamicCrt::crt_regex() const + const std::regex OutdatedDynamicCrt::crt_regex() const { const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; -- cgit v1.2.3