From c61e58509f0c5e43c4f1da1d380501a09bcb8747 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 3 Mar 2016 11:57:38 -0800 Subject: Remove other remaining use of std::list::size() from loop body. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1761993002 . --- core/src/fxcodec/jbig2/JBig2_Context.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp index 958c4a63e2..399ff68657 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp @@ -20,6 +20,7 @@ #include "core/src/fxcodec/jbig2/JBig2_PddProc.h" #include "core/src/fxcodec/jbig2/JBig2_SddProc.h" #include "core/src/fxcodec/jbig2/JBig2_TrdProc.h" +#include "third_party/base/stl_util.h" namespace { @@ -637,9 +638,11 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment, if (m_bIsGlobal && kSymbolDictCacheMaxSize > 0) { std::unique_ptr value = pSegment->m_Result.sd->DeepCopy(); - while (m_pSymbolDictCache->size() >= kSymbolDictCacheMaxSize) { + int size = pdfium::CollectionSize(*m_pSymbolDictCache); + while (size >= kSymbolDictCacheMaxSize) { delete m_pSymbolDictCache->back().second; m_pSymbolDictCache->pop_back(); + --size; } m_pSymbolDictCache->push_front(CJBig2_CachePair(key, value.release())); } -- cgit v1.2.3