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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

Issue 1541703003: Use std::map as CPDF_Dictionary's underlying store. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase + address comments Created 4 years, 11 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/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index c9eee8e380838de182e960a96f187d3b5b082278..1f2a36ca09581c0ae2089681081ceb39dc85b9c9 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -1214,10 +1214,8 @@ CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj) {
return nullptr;
CPDF_ColorSpace* pRet = nullptr;
Tom Sepez 2016/01/08 00:33:52 nit: this could go inside the loop.
Oliver Chang 2016/01/08 23:14:58 Done.
- FX_POSITION pos = pDict->GetStartPos();
- while (pos) {
- CFX_ByteString bsKey;
- CPDF_Object* pValue = pDict->GetNextElement(pos, bsKey);
+ for (const auto& it : *pDict) {
+ CPDF_Object* pValue = it.second;
if (ToName(pValue))
pRet = _CSFromName(pValue->GetString());
if (pRet)

Powered by Google App Engine
This is Rietveld 408576698