mirror of
https://github.com/google/googletest.git
synced 2025-01-04 17:05:40 +08:00
Merge pull request #1627 from atetubou/stdstring
Reduce the number of strcmp calling while initialization
This commit is contained in:
commit
ce468a17c4
@ -4907,11 +4907,11 @@ TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
|
|||||||
Test::SetUpTestCaseFunc set_up_tc,
|
Test::SetUpTestCaseFunc set_up_tc,
|
||||||
Test::TearDownTestCaseFunc tear_down_tc) {
|
Test::TearDownTestCaseFunc tear_down_tc) {
|
||||||
// Can we find a TestCase with the given name?
|
// Can we find a TestCase with the given name?
|
||||||
const std::vector<TestCase*>::const_iterator test_case =
|
const std::vector<TestCase*>::const_reverse_iterator test_case =
|
||||||
std::find_if(test_cases_.begin(), test_cases_.end(),
|
std::find_if(test_cases_.rbegin(), test_cases_.rend(),
|
||||||
TestCaseNameIs(test_case_name));
|
TestCaseNameIs(test_case_name));
|
||||||
|
|
||||||
if (test_case != test_cases_.end())
|
if (test_case != test_cases_.rend())
|
||||||
return *test_case;
|
return *test_case;
|
||||||
|
|
||||||
// No. Let's create one.
|
// No. Let's create one.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user