diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-16 16:21:58 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-16 16:21:58 -0700 |
commit | 316e482630d5f5d9084edd9725f98a0d89a5bbdf (patch) | |
tree | d0da57af48d88a18e0cd7dca9093057316da4078 /core/src/fpdftext | |
parent | 3d7d1d2f29e5fb099367a40822684d31f684fd62 (diff) | |
download | pdfium-316e482630d5f5d9084edd9725f98a0d89a5bbdf.tar.xz |
Don't bother passing -1 as the length to the CFX_ByteString ctor.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1406363002 .
Diffstat (limited to 'core/src/fpdftext')
-rw-r--r-- | core/src/fpdftext/fpdf_text.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index 40f5dd4926..9ecbc21bda 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -22,10 +22,7 @@ CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, return CFX_ByteString((char)unicode); } const FX_CHAR* altstr = FCS_GetAltStr(unicode); - if (altstr) { - return CFX_ByteString(altstr, -1); - } - return CFX_ByteString(defchar, -1); + return CFX_ByteString(altstr ? altstr : defchar); } char buf[10]; int iDef = 0; @@ -35,10 +32,7 @@ CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, return CFX_ByteString(buf, ret); } const FX_CHAR* altstr = FCS_GetAltStr(unicode); - if (altstr) { - return CFX_ByteString(altstr, -1); - } - return CFX_ByteString(defchar, -1); + return CFX_ByteString(altstr ? altstr : defchar); } CTextPage::CTextPage() {} CTextPage::~CTextPage() { |