Bug 185961 - Avoid constructing the string "all" repeatedly in MediaQueryParser
Summary: Avoid constructing the string "all" repeatedly in MediaQueryParser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-24 14:37 PDT by Chris Dumez
Modified: 2018-05-25 21:24 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.02 KB, patch)
2018-05-24 14:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-05-24 14:37:52 PDT
Avoid constructing the string "all" repeatedly in MediaQueryParser.
Comment 1 Chris Dumez 2018-05-24 14:41:06 PDT
Created attachment 341225 [details]
Patch
Comment 2 Simon Fraser (smfr) 2018-05-24 16:42:41 PDT
Comment on attachment 341225 [details]
Patch

Maybe we should use AtomicStrings for media types?
Comment 3 WebKit Commit Bot 2018-05-24 17:09:47 PDT
Comment on attachment 341225 [details]
Patch

Clearing flags on attachment: 341225

Committed r232173: <https://trac.webkit.org/changeset/232173>
Comment 4 WebKit Commit Bot 2018-05-24 17:09:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2018-05-24 17:10:21 PDT
<rdar://problem/40540318>
Comment 6 Darin Adler 2018-05-25 21:24:31 PDT
This change is OK, but I wonder why we need std::optional<String> since String already has distinct null and empty values. Maybe use a null string instead of std::nullopt?