Skip to content

Commit 10453de

Browse files
authored
cleanup(generator): make static variable trivially destructible (#14599)
1 parent 60ff702 commit 10453de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generator/internal/http_option_utils.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,9 @@ std::string FormatApiVersionFromPackageName(
399399
std::string FormatApiVersionFromUrlPattern(std::string const& url_pattern,
400400
std::string const& file_name) {
401401
std::vector<std::string> parts = absl::StrSplit(url_pattern, '/');
402-
static std::regex const kRe{R"(v\d+)"};
402+
static auto const* const kVersion = new std::regex{R"(v\d+)"};
403403
for (auto const& part : parts) {
404-
if (std::regex_match(part, kRe)) {
404+
if (std::regex_match(part, *kVersion)) {
405405
return part;
406406
}
407407
}

0 commit comments

Comments
 (0)