Commit 3de3db8b authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Remove a shadow variable in printing::PageRange.

Change-Id: I269b9b0249500cee9ea4c123951d89c347f791e3
Reviewed-on: https://chromium-review.googlesource.com/974319Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545106}
parent f468a538
......@@ -8,20 +8,16 @@
#include <set>
namespace {
const std::size_t kMaxNumberOfPages = 100000;
}
namespace printing {
/* static */
// static
std::vector<int> PageRange::GetPages(const PageRanges& ranges) {
// TODO(vitalybuka): crbug.com/95548 Remove this method as part fix.
std::set<int> pages;
for (unsigned i = 0; i < ranges.size(); ++i) {
const PageRange& range = ranges[i];
for (const PageRange& range : ranges) {
// Ranges are inclusive.
for (int i = range.from; i <= range.to; ++i) {
static constexpr size_t kMaxNumberOfPages = 100000;
pages.insert(i);
if (pages.size() >= kMaxNumberOfPages)
return std::vector<int>(pages.begin(), pages.end());
......
......@@ -7,13 +7,13 @@
#include <vector>
#include "printing_export.h"
#include "printing/printing_export.h"
namespace printing {
struct PageRange;
typedef std::vector<PageRange> PageRanges;
using PageRanges = std::vector<PageRange>;
// Print range is inclusive. To select one page, set from == to.
struct PRINTING_EXPORT PageRange {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment