Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(881)

Unified Diff: core/fpdfapi/fpdf_font/cpdf_cidfont.cpp

Issue 1867183002: Use std::vector as internal storage for CPDF_Array (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
index 3329f5c5771de32d027ad2a5cefffe5619bdbc59..034f6f6ecee5a9648a7dad15c9fa92fcef52f56e 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
@@ -817,8 +817,7 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
int iCurElement = 0;
int first_code = 0;
int last_code = 0;
- uint32_t count = pArray->GetCount();
- for (uint32_t i = 0; i < count; i++) {
+ for (size_t i = 0; i < pArray->GetCount(); i++) {
CPDF_Object* pObj = pArray->GetDirectObjectAt(i);
if (!pObj)
continue;
@@ -827,8 +826,7 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
if (width_status != 1)
return;
- uint32_t count = pArray->GetCount();
- for (uint32_t j = 0; j < count; j += nElements) {
+ for (size_t j = 0; j < pArray->GetCount(); j += nElements) {
result.Add(first_code);
result.Add(first_code);
for (int k = 0; k < nElements; k++) {

Powered by Google App Engine
This is Rietveld 408576698