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

Unified Diff: core/fpdfapi/fpdf_font/fpdf_font_cid.cpp

Issue 1889003002: Avoid string allocs for CMap_GetString() return value. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove some calls where the result is not used. Created 4 years, 8 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
« no previous file with comments | « core/fpdfapi/fpdf_font/font_int.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index f84fa9f2f96ff39bd2350c7e087326a52113a407..d5fe4dfd92ef582abc1a9452adca739743c5e18e 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -190,7 +190,7 @@ CIDSet CIDSetFromSizeT(size_t index) {
return static_cast<CIDSet>(index);
}
-CFX_ByteString CMap_GetString(const CFX_ByteStringC& word) {
+CFX_ByteStringC CMap_GetString(const CFX_ByteStringC& word) {
return word.Mid(1, word.GetLength() - 2);
}
@@ -407,13 +407,11 @@ void CPDF_CMapParser::ParseWord(const CFX_ByteStringC& word) {
}
m_CodeSeq = 0;
} else if (m_Status == 3) {
- CMap_GetString(word);
m_Status = 0;
} else if (m_Status == 4) {
m_pCMap->m_Charset = CharsetFromOrdering(CMap_GetString(word));
m_Status = 0;
} else if (m_Status == 5) {
- CMap_GetCode(word);
m_Status = 0;
} else if (m_Status == 6) {
m_pCMap->m_bVertical = CMap_GetCode(word);
@@ -788,9 +786,9 @@ void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr,
FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount);
}
-CIDSet CharsetFromOrdering(const CFX_ByteString& ordering) {
+CIDSet CharsetFromOrdering(const CFX_ByteStringC& ordering) {
for (size_t charset = 1; charset < FX_ArraySize(g_CharsetNames); ++charset) {
- if (ordering == CFX_ByteStringC(g_CharsetNames[charset]))
+ if (ordering == g_CharsetNames[charset])
return CIDSetFromSizeT(charset);
}
return CIDSET_UNKNOWN;
« no previous file with comments | « core/fpdfapi/fpdf_font/font_int.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698