Improve str concatenation performance on MatchesTest

Update str concatenation, instead of use operation+ use absl::StrCat
whenever available.

PiperOrigin-RevId: 874649732
Change-Id: I0acd91c04a9e50fa306e7130479bc330c1a0f068
This commit is contained in:
Abseil Team
2026-02-24 09:26:47 -08:00
committed by Copybara-Service
parent a407966592
commit 73a63ea05d

View File

@@ -885,7 +885,11 @@ class PositiveAndNegativeUnitTestFilter {
// and does not match the negative filter.
bool MatchesTest(const std::string& test_suite_name,
const std::string& test_name) const {
#ifdef GTEST_HAS_ABSL
return MatchesName(absl::StrCat(test_suite_name, ".", test_name));
#else
return MatchesName(test_suite_name + "." + test_name);
#endif
}
// Returns true if and only if name matches the positive filter and does not