Title: [170402] trunk/Source/WebCore
Revision
170402
Author
mmaxfi...@apple.com
Date
2014-06-24 16:32:31 -0700 (Tue, 24 Jun 2014)

Log Message

advanceByCombiningCharacterSequence() can be simplified
https://bugs.webkit.org/show_bug.cgi?id=133591

Reviewed by Dean Jackson.

Use U16_NEXT() because it already does what we're trying to do.

No new tests because there is no behavior change.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::advanceByCombiningCharacterSequence):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170401 => 170402)


--- trunk/Source/WebCore/ChangeLog	2014-06-24 23:18:55 UTC (rev 170401)
+++ trunk/Source/WebCore/ChangeLog	2014-06-24 23:32:31 UTC (rev 170402)
@@ -1,3 +1,17 @@
+2014-06-24  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        advanceByCombiningCharacterSequence() can be simplified
+        https://bugs.webkit.org/show_bug.cgi?id=133591
+
+        Reviewed by Dean Jackson.
+
+        Use U16_NEXT() because it already does what we're trying to do.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::advanceByCombiningCharacterSequence):
+
 2014-06-24  Brady Eidson  <beid...@apple.com>
 
         Enable GAMEPAD in the Mac build, but disabled at runtime.

Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (170401 => 170402)


--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2014-06-24 23:18:55 UTC (rev 170401)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2014-06-24 23:32:31 UTC (rev 170402)
@@ -268,18 +268,12 @@
 
     markCount = 0;
 
-    baseCharacter = *iterator++;
+    unsigned i = 0;
+    U16_NEXT(iterator, i, end - iterator, baseCharacter);
+    iterator = iterator + i;
 
-    if (U16_IS_SURROGATE(baseCharacter)) {
-        if (!U16_IS_LEAD(baseCharacter))
-            return false;
-        if (iterator == end)
-            return false;
-        UChar trail = *iterator++;
-        if (!U16_IS_TRAIL(trail))
-            return false;
-        baseCharacter = U16_GET_SUPPLEMENTARY(baseCharacter, trail);
-    }
+    if (U16_IS_SURROGATE(baseCharacter))
+        return false;
 
     // Consume marks.
     while (iterator < end) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to