Title: [294369] trunk/Source/WebCore/platform/graphics/FontCascade.cpp
Revision
294369
Author
[email protected]
Date
2022-05-17 17:37:45 -0700 (Tue, 17 May 2022)

Log Message

Stop using ASCIILiteral::fromLiteralUnsafe() in FontCascade.cpp https://bugs.webkit.org/show_bug.cgi?id=240548

Reviewed by Myles C. Maxfield.

Stop using ASCIILiteral::fromLiteralUnsafe() in FontCascade.cpp and use ASCIILiteral
directly.

* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::useBackslashAsYenSignForFamily):

Canonical link: https://commits.webkit.org/250668@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (294368 => 294369)


--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2022-05-18 00:27:10 UTC (rev 294368)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2022-05-18 00:37:45 UTC (rev 294369)
@@ -53,16 +53,16 @@
         return false;
     static NeverDestroyed set = [] {
         MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
-        auto add = [&set] (const char* name, std::initializer_list<UChar> unicodeName) {
-            set.add(AtomString { ASCIILiteral::fromLiteralUnsafe(name) });
+        auto add = [&set] (ASCIILiteral name, std::initializer_list<UChar> unicodeName) {
+            set.add(AtomString { name });
             unsigned unicodeNameLength = unicodeName.size();
             set.add(AtomString { unicodeName.begin(), unicodeNameLength });
         };
-        add("MS PGothic", { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
-        add("MS PMincho", { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x660E, 0x671D });
-        add("MS Gothic", { 0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
-        add("MS Mincho", { 0xFF2D, 0xFF33, 0x0020, 0x660E, 0x671D });
-        add("Meiryo", { 0x30E1, 0x30A4, 0x30EA, 0x30AA });
+        add("MS PGothic"_s, { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
+        add("MS PMincho"_s, { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x660E, 0x671D });
+        add("MS Gothic"_s, { 0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
+        add("MS Mincho"_s, { 0xFF2D, 0xFF33, 0x0020, 0x660E, 0x671D });
+        add("Meiryo"_s, { 0x30E1, 0x30A4, 0x30EA, 0x30AA });
         return set;
     }();
     return set.get().contains(family);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to