Skip to content

Commit

Permalink
Cleanup: Remove dead code - PageRange::GetTotalPages.
Browse files Browse the repository at this point in the history
BUG=none
TEST=none

Review URL: http://codereview.chromium.org/8002013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102610 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed Sep 23, 2011
1 parent 1d2ee72 commit e231975
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
9 changes: 1 addition & 8 deletions printing/page_range.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -22,11 +22,4 @@ std::vector<int> PageRange::GetPages(const PageRanges& ranges) {
return std::vector<int>(pages.begin(), pages.end());
}

/* static */
int PageRange::GetTotalPages(const PageRanges& ranges) {
// Since ranges can overlap we need to merge them before counting
std::vector<int> pages = PageRange::GetPages(ranges);
return pages.size();
}

} // namespace printing
3 changes: 0 additions & 3 deletions printing/page_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ struct PRINTING_EXPORT PageRange {

// Retrieves the sorted list of unique pages in the page ranges.
static std::vector<int> GetPages(const PageRanges& ranges);

// Gets the total number of pages.
static int GetTotalPages(const PageRanges& ranges);
};

} // namespace printing
Expand Down
4 changes: 1 addition & 3 deletions printing/page_range_unittest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down Expand Up @@ -27,12 +27,10 @@ TEST(PageRangeTest, RangeMerge) {
EXPECT_EQ(10, pages[5]);
EXPECT_EQ(11, pages[6]);
EXPECT_EQ(12, pages[7]);
EXPECT_EQ(8, printing::PageRange::GetTotalPages(ranges));
}

TEST(PageRangeTest, Empty) {
printing::PageRanges ranges;
std::vector<int> pages(printing::PageRange::GetPages(ranges));
EXPECT_EQ(0U, pages.size());
EXPECT_EQ(0, printing::PageRange::GetTotalPages(ranges));
}

0 comments on commit e231975

Please sign in to comment.