From 0e12ed7557f060539122d535dcfc717e8763b138 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 28 Nov 2017 19:29:29 +0000 Subject: Remove CollectionSize from fpdf_flatten. Bug: pdfium:774 Change-Id: Ie733da2852d2721ef8007aa55d32ffa9537efb70 Reviewed-on: https://pdfium-review.googlesource.com/19630 Reviewed-by: Ryan Harrison Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/fpdf_flatten.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index 07fbd7cd9e..2850c37bfb 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -299,8 +299,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { pPageXObject = pRes->SetNewFor("XObject"); ByteString key; - int nStreams = pdfium::CollectionSize(ObjectArray); - if (nStreams > 0) { + if (!ObjectArray.empty()) { int i = 0; while (i < INT_MAX) { ByteString sKey = ByteString::Format("FFT%d", i); @@ -326,7 +325,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { pNewOXbjectDic->SetRectFor("BBox", rcBBox); } - for (int i = 0; i < nStreams; i++) { + for (size_t i = 0; i < ObjectArray.size(); ++i) { CPDF_Dictionary* pAnnotDic = ObjectArray[i]; if (!pAnnotDic) continue; -- cgit v1.2.3