Skip to content

Commit 73a63ea

Browse files
Abseil Teamcopybara-github
authored andcommitted
Improve str concatenation performance on MatchesTest
Update str concatenation, instead of use operation+ use absl::StrCat whenever available. PiperOrigin-RevId: 874649732 Change-Id: I0acd91c04a9e50fa306e7130479bc330c1a0f068
1 parent a407966 commit 73a63ea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

googletest/src/gtest.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,11 @@ class PositiveAndNegativeUnitTestFilter {
885885
// and does not match the negative filter.
886886
bool MatchesTest(const std::string& test_suite_name,
887887
const std::string& test_name) const {
888+
#ifdef GTEST_HAS_ABSL
889+
return MatchesName(absl::StrCat(test_suite_name, ".", test_name));
890+
#else
888891
return MatchesName(test_suite_name + "." + test_name);
892+
#endif
889893
}
890894

891895
// Returns true if and only if name matches the positive filter and does not

0 commit comments

Comments
 (0)