summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-03 11:57:38 -0800
committerTom Sepez <tsepez@chromium.org>2016-03-03 11:57:38 -0800
commitc61e58509f0c5e43c4f1da1d380501a09bcb8747 (patch)
tree7e67f06d647cdfc56205649a44235c4382e9d61f
parent0e2e5d7554af277cfb312294378c2cd862a349d5 (diff)
downloadpdfium-c61e58509f0c5e43c4f1da1d380501a09bcb8747.tar.xz
Remove other remaining use of std::list::size() from loop body.
R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1761993002 .
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Context.cpp5
1 files changed, 4 insertions, 1 deletions
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<CJBig2_SymbolDict> value =
pSegment->m_Result.sd->DeepCopy();
- while (m_pSymbolDictCache->size() >= kSymbolDictCacheMaxSize) {
+ int size = pdfium::CollectionSize<int>(*m_pSymbolDictCache);
+ while (size >= kSymbolDictCacheMaxSize) {
delete m_pSymbolDictCache->back().second;
m_pSymbolDictCache->pop_back();
+ --size;
}
m_pSymbolDictCache->push_front(CJBig2_CachePair(key, value.release()));
}