⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294369 in webkit


Ignore:
Timestamp:
May 17, 2022, 5:37:45 PM (4 years ago)
Author:
Chris Dumez
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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/platform/graphics/FontCascade.cpp

    r294145 r294369  
    5454    static NeverDestroyed set = [] {
    5555        MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
    56         auto add = [&set] (const char* name, std::initializer_list<UChar> unicodeName) {
    57             set.add(AtomString { ASCIILiteral::fromLiteralUnsafe(name) });
     56        auto add = [&set] (ASCIILiteral name, std::initializer_list<UChar> unicodeName) {
     57            set.add(AtomString { name });
    5858            unsigned unicodeNameLength = unicodeName.size();
    5959            set.add(AtomString { unicodeName.begin(), unicodeNameLength });
    6060        };
    61         add("MS PGothic", { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
    62         add("MS PMincho", { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x660E, 0x671D });
    63         add("MS Gothic", { 0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
    64         add("MS Mincho", { 0xFF2D, 0xFF33, 0x0020, 0x660E, 0x671D });
    65         add("Meiryo", { 0x30E1, 0x30A4, 0x30EA, 0x30AA });
     61        add("MS PGothic"_s, { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
     62        add("MS PMincho"_s, { 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x660E, 0x671D });
     63        add("MS Gothic"_s, { 0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF });
     64        add("MS Mincho"_s, { 0xFF2D, 0xFF33, 0x0020, 0x660E, 0x671D });
     65        add("Meiryo"_s, { 0x30E1, 0x30A4, 0x30EA, 0x30AA });
    6666        return set;
    6767    }();
Note: See TracChangeset for help on using the changeset viewer.