From e0e922db5fb77df9a5a9cc802096f484ed21da1c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 3 Nov 2015 14:54:35 -0500 Subject: Revert "Revert "Cleanup some numeric code."" This reverts commit 23d576f0b498bd4f37ef2175916223a2e5ea0324. 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. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1405253007 . --- core/src/fpdftext/fpdf_text_int.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/src/fpdftext/fpdf_text_int.cpp') diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 9ab09e19e4..4459552c84 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -2433,12 +2433,11 @@ FX_BOOL CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText, } if ((char_left > 'A' && char_left < 'a') || (char_left > 'a' && char_left < 'z') || - (char_left > 0xfb00 && char_left < 0xfb06) || - (char_left >= '0' && char_left <= '9') || + (char_left > 0xfb00 && char_left < 0xfb06) || std::isdigit(char_left) || (char_right > 'A' && char_right < 'a') || (char_right > 'a' && char_right < 'z') || (char_right > 0xfb00 && char_right < 0xfb06) || - (char_right >= '0' && char_right <= '9')) { + std::isdigit(char_right)) { return FALSE; } if (!(('A' > char_left || char_left > 'Z') && -- cgit v1.2.3