Summary: | [Intl] Disprefer using ICU enums directly as instance variables | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ross Kirsling <ross.kirsling> | ||||||
Component: | New Bugs | Assignee: | Ross Kirsling <ross.kirsling> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | darin, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Ross Kirsling
2020-06-24 19:09:44 PDT
Created attachment 402707 [details]
Patch
Here's the patch whether we choose to use it or not. Either way, IntlPluralRules is 72 bytes (padding 6 → 9) and IntlRelativeTimeFormat is 56 bytes (padding 3 → 6). Comment on attachment 402707 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402707&action=review r=me > Source/JavaScriptCore/runtime/IntlPluralRules.h:83 > + bool m_isOrdinal { false }; I think `enum class OrdinalType : uint8_t { Ordinal, Cardinal };` would be better. Created attachment 402708 [details]
Patch for landing
Committed r263497: <https://trac.webkit.org/changeset/263497> All reviewed patches have been landed. Closing bug and clearing flags on attachment 402708 [details]. Comment on attachment 402707 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402707&action=review >> Source/JavaScriptCore/runtime/IntlPluralRules.h:83 >> + bool m_isOrdinal { false }; > > I think `enum class OrdinalType : uint8_t { Ordinal, Cardinal };` would be better. Why not "enum class OrdinalType : bool { Cardinal, Ordinal };"? (In reply to Darin Adler from comment #6) > Comment on attachment 402707 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=402707&action=review > > >> Source/JavaScriptCore/runtime/IntlPluralRules.h:83 > >> + bool m_isOrdinal { false }; > > > > I think `enum class OrdinalType : uint8_t { Ordinal, Cardinal };` would be better. > > Why not "enum class OrdinalType : bool { Cardinal, Ordinal };"? I landed it as Type : bool. |