summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-06-14 03:54:01 (GMT)
committerGitHub <noreply@github.com>2018-06-14 03:54:01 (GMT)
commitce468a17c434e4e79724396ee1b51d86bfc8a88b (patch)
tree19f2242ee6959064b44c2749454f7814301c1d9b
parent885808cccbecc95185cb4d413e65a2aa39f4d303 (diff)
parenta0d43a7bb8508e2917468b5603d9e55259d4a0f0 (diff)
downloadgoogletest-ce468a17c434e4e79724396ee1b51d86bfc8a88b.zip
googletest-ce468a17c434e4e79724396ee1b51d86bfc8a88b.tar.gz
googletest-ce468a17c434e4e79724396ee1b51d86bfc8a88b.tar.bz2
Merge pull request #1627 from atetubou/stdstring
Reduce the number of strcmp calling while initialization
-rw-r--r--googletest/src/gtest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 3498ffe..bd6ab7b 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -4907,11 +4907,11 @@ TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc) {
// Can we find a TestCase with the given name?
- const std::vector<TestCase*>::const_iterator test_case =
- std::find_if(test_cases_.begin(), test_cases_.end(),
+ const std::vector<TestCase*>::const_reverse_iterator test_case =
+ std::find_if(test_cases_.rbegin(), test_cases_.rend(),
TestCaseNameIs(test_case_name));
- if (test_case != test_cases_.end())
+ if (test_case != test_cases_.rend())
return *test_case;
// No. Let's create one.