summaryrefslogtreecommitdiff
path: root/core/fpdfapi/cmaps/fpdf_cmaps.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-05 20:27:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-05 20:27:02 +0000
commitc45271e053c8c458cefa4ccf847c85b7d1df3f09 (patch)
tree281529b69ec20663958d20d6d0ac76f31177e841 /core/fpdfapi/cmaps/fpdf_cmaps.cpp
parent82f2afe603ccb1e879a7a292259b0882b3d27bb6 (diff)
downloadpdfium-c45271e053c8c458cefa4ccf847c85b7d1df3f09.tar.xz
Remove redundant field in struct FXCMAP_CMap.
Change-Id: Ibac6398b5849820562830bb8ed95c3428496f7ef Reviewed-on: https://pdfium-review.googlesource.com/20410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/cmaps/fpdf_cmaps.cpp')
-rw-r--r--core/fpdfapi/cmaps/fpdf_cmaps.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/fpdfapi/cmaps/fpdf_cmaps.cpp b/core/fpdfapi/cmaps/fpdf_cmaps.cpp
index f0dcce5b39..96913726be 100644
--- a/core/fpdfapi/cmaps/fpdf_cmaps.cpp
+++ b/core/fpdfapi/cmaps/fpdf_cmaps.cpp
@@ -71,8 +71,7 @@ uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode) {
ASSERT(pMap);
if (charcode >> 16) {
while (pMap) {
- if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
- ASSERT(pMap->m_pDWordMap);
+ if (pMap->m_pDWordMap) {
auto* found = static_cast<FXCMAP_DWordCIDMap*>(
bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount,
sizeof(FXCMAP_DWordCIDMap), compareDWordRange));
@@ -80,9 +79,6 @@ uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode) {
return found->m_CID + static_cast<uint16_t>(charcode) -
found->m_LoWordLow;
}
- } else {
- ASSERT(pMap->m_DWordMapType == FXCMAP_CMap::None);
- ASSERT(!pMap->m_pDWordMap);
}
pMap = FindNextCMap(pMap);
}
@@ -99,7 +95,8 @@ uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode) {
if (found)
return found[1];
- } else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
+ } else {
+ ASSERT(pMap->m_WordMapType == FXCMAP_CMap::Range);
uint16_t* found = static_cast<uint16_t*>(bsearch(
&code, pMap->m_pWordMap, pMap->m_WordCount, 6, compareWordRange));
if (found)
@@ -127,7 +124,8 @@ uint32_t FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, uint16_t cid) {
pCur += 2;
}
- } else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
+ } else {
+ ASSERT(pMap->m_WordMapType == FXCMAP_CMap::Range);
const uint16_t* pCur = pMap->m_pWordMap;
const uint16_t* pEnd = pMap->m_pWordMap + pMap->m_WordCount * 3;
while (pCur < pEnd) {