summaryrefslogtreecommitdiffstats
path: root/src/gtest-test-part.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-07-01 22:55:05 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-07-01 22:55:05 (GMT)
commit600105ee3ac48a01143486e5536a5b8fff5b5b25 (patch)
treee321c70ebc0eb178e91fcbf9993cdbeb5606c8e2 /src/gtest-test-part.cc
parentb2db677c9905a34ca6454aa526f7a0cc5cfaeca1 (diff)
downloadgoogletest-600105ee3ac48a01143486e5536a5b8fff5b5b25.zip
googletest-600105ee3ac48a01143486e5536a5b8fff5b5b25.tar.gz
googletest-600105ee3ac48a01143486e5536a5b8fff5b5b25.tar.bz2
Makes List a random-access data structure. This simplifies the implementation and makes it easier to implement test shuffling.
Diffstat (limited to 'src/gtest-test-part.cc')
-rw-r--r--src/gtest-test-part.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gtest-test-part.cc b/src/gtest-test-part.cc
index 49a6fe5..472b8c5 100644
--- a/src/gtest-test-part.cc
+++ b/src/gtest-test-part.cc
@@ -86,12 +86,7 @@ const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
internal::posix::Abort();
}
- const internal::ListNode<TestPartResult>* p = list_->Head();
- for (int i = 0; i < index; i++) {
- p = p->next();
- }
-
- return p->element();
+ return list_->GetElement(index);
}
// Returns the number of TestPartResult objects in the array.