Changeset 239289 in webkit


Ignore:
Timestamp:
Dec 17, 2018 1:47:53 PM (5 years ago)
Author:
dbates@webkit.org
Message:

Make DocumentMarker::allMarkers() constexpr
https://bugs.webkit.org/show_bug.cgi?id=192634

Reviewed by Simon Fraser.

The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
it constexpr to do just that.

  • dom/DocumentMarker.h:

(WebCore::DocumentMarker::allMarkers):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239288 r239289  
     12018-12-17  Daniel Bates  <dabates@apple.com>
     2
     3        Make DocumentMarker::allMarkers() constexpr
     4        https://bugs.webkit.org/show_bug.cgi?id=192634
     5
     6        Reviewed by Simon Fraser.
     7
     8        The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
     9        it constexpr to do just that.
     10
     11        * dom/DocumentMarker.h:
     12        (WebCore::DocumentMarker::allMarkers):
     13
    1142018-12-17  Justin Fan  <justin_fan@apple.com>
    215
  • trunk/Source/WebCore/dom/DocumentMarker.h

    r237266 r239289  
    8383    };
    8484
    85     static OptionSet<MarkerType> allMarkers();
     85    static constexpr OptionSet<MarkerType> allMarkers();
    8686
    8787    using IsActiveMatchData = bool;
     
    142142};
    143143
    144 inline auto DocumentMarker::allMarkers() -> OptionSet<MarkerType>
    145 {
    146     OptionSet<MarkerType> markers {
     144constexpr auto DocumentMarker::allMarkers() -> OptionSet<MarkerType>
     145{
     146    return {
    147147        AcceptedCandidate,
    148148        Autocorrected,
     
    165165#endif
    166166    };
    167     return markers;
    168167}
    169168
Note: See TracChangeset for help on using the changeset viewer.