From 9f0bba48c208722c8d05eaa5382254f3183c65b7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 27 Nov 2017 18:13:46 +0000 Subject: Remove use of CollectionSize from CPDF_CMapParser Bug: pdfium:774 Change-Id: Ie24d0741f8c8d7988166aeb4b9ce87491993d30c Reviewed-on: https://pdfium-review.googlesource.com/19390 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- core/fpdfapi/font/cpdf_cmapparser.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'core/fpdfapi/font') diff --git a/core/fpdfapi/font/cpdf_cmapparser.cpp b/core/fpdfapi/font/cpdf_cmapparser.cpp index fbd6daf851..a88448c5bd 100644 --- a/core/fpdfapi/font/cpdf_cmapparser.cpp +++ b/core/fpdfapi/font/cpdf_cmapparser.cpp @@ -17,7 +17,6 @@ #include "core/fxcrt/fx_extension.h" #include "core/fxge/fx_freetype.h" #include "third_party/base/logging.h" -#include "third_party/base/stl_util.h" namespace { @@ -110,14 +109,14 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) { m_Status = 0; } else if (m_Status == 7) { if (word == "endcodespacerange") { - uint32_t nSegs = pdfium::CollectionSize(m_CodeRanges); - if (nSegs > 1) { - m_pCMap->SetCodingScheme(CPDF_CMap::MixedFourBytes); - m_pCMap->SetMixedFourByteLeadingRanges(m_CodeRanges); - } else if (nSegs == 1) { + size_t nSegs = m_CodeRanges.size(); + if (nSegs == 1) { m_pCMap->SetCodingScheme((m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte); + } else if (nSegs > 1) { + m_pCMap->SetCodingScheme(CPDF_CMap::MixedFourBytes); + m_pCMap->SetMixedFourByteLeadingRanges(m_CodeRanges); } m_Status = 0; } else { -- cgit v1.2.3