From 600105ee3ac48a01143486e5536a5b8fff5b5b25 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Wed, 1 Jul 2009 22:55:05 +0000 Subject: Makes List a random-access data structure. This simplifies the implementation and makes it easier to implement test shuffling. --- src/gtest-test-part.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/gtest-test-part.cc') diff --git a/src/gtest-test-part.cc b/src/gtest-test-part.cc index 49a6fe5a..472b8c58 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* 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. -- cgit v1.2.3