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

Unified Diff: third_party/WebKit/Source/platform/fonts/CharacterTest.cpp

Issue 1644893002: Revert of Improve performance of Character::isCJKIdeographOrSymbol by using trie tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/platform/fonts/CharacterTest.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/CharacterTest.cpp b/third_party/WebKit/Source/platform/fonts/CharacterTest.cpp
index 9cfc8720c18575a1d5e328414e0177f814f51b5b..d285d3d65d1c879d95a4d1b3fc30c475c11216b7 100644
--- a/third_party/WebKit/Source/platform/fonts/CharacterTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/CharacterTest.cpp
@@ -143,17 +143,13 @@
EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c6, 3));
}
-static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart,
- UChar32 rangeEnd,
- bool before = true)
-{
- if (before)
- EXPECT_FALSE(Character::isCJKIdeographOrSymbol(rangeStart - 1));
- EXPECT_TRUE(Character::isCJKIdeographOrSymbol(rangeStart));
- EXPECT_TRUE(Character::isCJKIdeographOrSymbol(
- (UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2));
- EXPECT_TRUE(Character::isCJKIdeographOrSymbol(rangeEnd));
- EXPECT_FALSE(Character::isCJKIdeographOrSymbol(rangeEnd + 1));
+static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, UChar32 rangeEnd)
+{
+ EXPECT_FALSE(Character::isCJKIdeograph(rangeStart - 1));
+ EXPECT_TRUE(Character::isCJKIdeograph(rangeStart));
+ EXPECT_TRUE(Character::isCJKIdeograph((UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2));
+ EXPECT_TRUE(Character::isCJKIdeograph(rangeEnd));
+ EXPECT_FALSE(Character::isCJKIdeograph(rangeEnd + 1));
}
TEST(CharacterTest, TestIsCJKIdeograph)
@@ -161,11 +157,11 @@
// The basic CJK Unified Ideographs block.
TestSpecificUChar32RangeIdeograph(0x4E00, 0x9FFF);
// CJK Unified Ideographs Extension A.
- TestSpecificUChar32RangeIdeograph(0x3400, 0x4DBF, false);
+ TestSpecificUChar32RangeIdeograph(0x3400, 0x4DBF);
// CJK Unified Ideographs Extension A and Kangxi Radicals.
TestSpecificUChar32RangeIdeograph(0x2E80, 0x2FDF);
// CJK Strokes.
- TestSpecificUChar32RangeIdeograph(0x31C0, 0x31EF, false);
+ TestSpecificUChar32RangeIdeograph(0x31C0, 0x31EF);
// CJK Compatibility Ideographs.
TestSpecificUChar32RangeIdeograph(0xF900, 0xFAFF);
// CJK Unified Ideographs Extension B.

Powered by Google App Engine
This is Rietveld 408576698