From 0d27868d0faef474594682f25336229daa89d6d7 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Thu, 25 Feb 2010 01:09:07 +0000 Subject: Simplifies the implementation by using std::vector instead of Vector. --- src/gtest-test-part.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/gtest-test-part.cc') diff --git a/src/gtest-test-part.cc b/src/gtest-test-part.cc index 4f36df66..7d9adef7 100644 --- a/src/gtest-test-part.cc +++ b/src/gtest-test-part.cc @@ -64,19 +64,9 @@ std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { << result.message() << std::endl; } -// Constructs an empty TestPartResultArray. -TestPartResultArray::TestPartResultArray() - : array_(new internal::Vector) { -} - -// Destructs a TestPartResultArray. -TestPartResultArray::~TestPartResultArray() { - delete array_; -} - // Appends a TestPartResult to the array. void TestPartResultArray::Append(const TestPartResult& result) { - array_->PushBack(result); + array_.push_back(result); } // Returns the TestPartResult at the given index (0-based). @@ -86,12 +76,12 @@ const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const { internal::posix::Abort(); } - return array_->GetElement(index); + return array_[index]; } // Returns the number of TestPartResult objects in the array. int TestPartResultArray::size() const { - return array_->size(); + return array_.size(); } namespace internal { -- cgit v1.2.3