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

Unified Diff: core/fpdfdoc/doc_utils.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/fpdfdoc/doc_utils.cpp
diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp
index 7e7fa8110f87378e981d5a84bc8b8b16922a868a..7bf01ebb8df3d31e20a320d6d23967d202391a0a 100644
--- a/core/fpdfdoc/doc_utils.cpp
+++ b/core/fpdfdoc/doc_utils.cpp
@@ -27,8 +27,7 @@ CPDF_Object* SearchNumberNode(const CPDF_Dictionary* pNode, int num) {
}
CPDF_Array* pNumbers = pNode->GetArrayBy("Nums");
if (pNumbers) {
- uint32_t dwCount = pNumbers->GetCount() / 2;
- for (uint32_t i = 0; i < dwCount; i++) {
+ for (size_t i = 0; i < pNumbers->GetCount() / 2; i++) {
int index = pNumbers->GetIntegerAt(i * 2);
if (num == index) {
return pNumbers->GetDirectObjectAt(i * 2 + 1);
@@ -43,7 +42,7 @@ CPDF_Object* SearchNumberNode(const CPDF_Dictionary* pNode, int num) {
if (!pKids) {
return NULL;
}
- for (uint32_t i = 0; i < pKids->GetCount(); i++) {
+ for (size_t i = 0; i < pKids->GetCount(); i++) {
CPDF_Dictionary* pKid = pKids->GetDictAt(i);
if (!pKid) {
continue;

Powered by Google App Engine
This is Rietveld 408576698