summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_xml_parser.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2015-11-10 13:33:04 -0500
committerdan sinclair <dsinclair@chromium.org>2015-11-10 13:33:04 -0500
commit0569ab0b11b723d9bca4ddd642b0cf8828c4bdd1 (patch)
treed0f6ba295574785c773536be7b5526680ed60f04 /core/src/fxcrt/fx_xml_parser.cpp
parente6e16954f0cdc324849fca9da883be8f131b3834 (diff)
downloadpdfium-0569ab0b11b723d9bca4ddd642b0cf8828c4bdd1.tar.xz
Revert x4 "Cleanup some numeric code."
This reverts commit b27902b8995bb3e003daed6b0811ed746763c68d. Cleanup some numeric code. This changes the various comparisons of char >= '0' && char <= '9' and char < '0' || char > '9' to use std::isdigit checks. It also cleans up a handful of hex to digit conversions to call one common method. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1432973003 .
Diffstat (limited to 'core/src/fxcrt/fx_xml_parser.cpp')
-rw-r--r--core/src/fxcrt/fx_xml_parser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 2d3ff6631e..429bc38289 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -6,7 +6,6 @@
#include "xml_int.h"
-#include "core/include/fxcrt/fx_ext.h"
#include "core/include/fxcrt/fx_xml.h"
CXML_Parser::~CXML_Parser() {
@@ -229,8 +228,9 @@ FX_DWORD CXML_Parser::GetCharRef() {
iState = 10;
break;
}
- if (g_FXCRT_XML_IsDigital(ch))
- code = code * 10 + FXSYS_toDecimalDigit(ch);
+ if (g_FXCRT_XML_IsDigital(ch)) {
+ code = code * 10 + ch - '0';
+ }
break;
case 4:
m_dwIndex++;
@@ -242,7 +242,7 @@ FX_DWORD CXML_Parser::GetCharRef() {
g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar;
if (nHex) {
if (nHex == FXCRTM_XML_CHARTYPE_HexDigital) {
- code = (code << 4) + FXSYS_toDecimalDigit(ch);
+ code = (code << 4) + ch - '0';
} else if (nHex == FXCRTM_XML_CHARTYPE_HexLowerLetter) {
code = (code << 4) + ch - 87;
} else {