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

Changeset 286974 in webkit


Ignore:
Timestamp:
Dec 13, 2021, 12:56:53 PM (5 years ago)
Author:
Alan Coon
Message:

Cherry-pick r286858. rdar://problem/86423741

Use simpler idioms for std::less and std::greater possible in modern C++
https://bugs.webkit.org/show_bug.cgi?id=234117

Reviewed by Anders Carlsson.

Source/WebCore:

  • testing/InternalsMapLike.cpp: (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit use of std:less, because this is what std::sort by default.

Source/WebKit:

  • WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded template arguments for std::greater, and removed explicit use of std::less, since that's what std::sort does by default.

Source/WTF:

  • wtf/ListDump.h: (WTF::sortedListDump): Removed unnecessary template arguments to std::less.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286858 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612-branch/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612-branch/Source/WTF/ChangeLog

    r286698 r286974  
     12021-12-13  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r286858. rdar://problem/86423741
     4
     5    Use simpler idioms for std::less and std::greater possible in modern C++
     6    https://bugs.webkit.org/show_bug.cgi?id=234117
     7   
     8    Reviewed by Anders Carlsson.
     9   
     10    Source/WebCore:
     11   
     12    * testing/InternalsMapLike.cpp:
     13    (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit
     14    use of std:less, because this is what std::sort by default.
     15   
     16    Source/WebKit:
     17   
     18    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     19    (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded
     20    template arguments for std::greater, and removed explicit use of std::less,
     21    since that's what std::sort does by default.
     22   
     23    Source/WTF:
     24   
     25    * wtf/ListDump.h:
     26    (WTF::sortedListDump): Removed unnecessary template arguments to std::less.
     27   
     28    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     29
     30    2021-12-09  Darin Adler  <darin@apple.com>
     31
     32            Use simpler idioms for std::less and std::greater possible in modern C++
     33            https://bugs.webkit.org/show_bug.cgi?id=234117
     34
     35            Reviewed by Anders Carlsson.
     36
     37            * wtf/ListDump.h:
     38            (WTF::sortedListDump): Removed unnecessary template arguments to std::less.
     39
    1402021-12-06  Alan Coon  <alancoon@apple.com>
    241
  • branches/safari-612-branch/Source/WTF/wtf/ListDump.h

    r237099 r286974  
    122122CString sortedListDump(const T& list, const char* comma = ", ")
    123123{
    124     return sortedListDump(list, std::less<typename T::ValueType>(), comma);
     124    return sortedListDump(list, std::less<>(), comma);
    125125}
    126126
  • branches/safari-612-branch/Source/WebCore/ChangeLog

    r286793 r286974  
     12021-12-13  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r286858. rdar://problem/86423741
     4
     5    Use simpler idioms for std::less and std::greater possible in modern C++
     6    https://bugs.webkit.org/show_bug.cgi?id=234117
     7   
     8    Reviewed by Anders Carlsson.
     9   
     10    Source/WebCore:
     11   
     12    * testing/InternalsMapLike.cpp:
     13    (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit
     14    use of std:less, because this is what std::sort by default.
     15   
     16    Source/WebKit:
     17   
     18    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     19    (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded
     20    template arguments for std::greater, and removed explicit use of std::less,
     21    since that's what std::sort does by default.
     22   
     23    Source/WTF:
     24   
     25    * wtf/ListDump.h:
     26    (WTF::sortedListDump): Removed unnecessary template arguments to std::less.
     27   
     28    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     29
     30    2021-12-09  Darin Adler  <darin@apple.com>
     31
     32            Use simpler idioms for std::less and std::greater possible in modern C++
     33            https://bugs.webkit.org/show_bug.cgi?id=234117
     34
     35            Reviewed by Anders Carlsson.
     36
     37            * testing/InternalsMapLike.cpp:
     38            (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit
     39            use of std:less, because this is what std::sort by default.
     40
    1412021-12-09  Alan Coon  <alancoon@apple.com>
    242
  • branches/safari-612-branch/Source/WebCore/testing/InternalsMapLike.cpp

    r253276 r286974  
    6969{
    7070    auto result = copyToVector(m_values.values());
    71     std::sort(result.begin(), result.end(), std::less<unsigned>());
     71    std::sort(result.begin(), result.end());
    7272    return result;
    7373}
  • branches/safari-612-branch/Source/WebKit/ChangeLog

    r286973 r286974  
     12021-12-13  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r286858. rdar://problem/86423741
     4
     5    Use simpler idioms for std::less and std::greater possible in modern C++
     6    https://bugs.webkit.org/show_bug.cgi?id=234117
     7   
     8    Reviewed by Anders Carlsson.
     9   
     10    Source/WebCore:
     11   
     12    * testing/InternalsMapLike.cpp:
     13    (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit
     14    use of std:less, because this is what std::sort by default.
     15   
     16    Source/WebKit:
     17   
     18    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     19    (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded
     20    template arguments for std::greater, and removed explicit use of std::less,
     21    since that's what std::sort does by default.
     22   
     23    Source/WTF:
     24   
     25    * wtf/ListDump.h:
     26    (WTF::sortedListDump): Removed unnecessary template arguments to std::less.
     27   
     28    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     29
     30    2021-12-09  Darin Adler  <darin@apple.com>
     31
     32            Use simpler idioms for std::less and std::greater possible in modern C++
     33            https://bugs.webkit.org/show_bug.cgi?id=234117
     34
     35            Reviewed by Anders Carlsson.
     36
     37            * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     38            (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded
     39            template arguments for std::greater, and removed explicit use of std::less,
     40            since that's what std::sort does by default.
     41
    1422021-12-13  Alan Coon  <alancoon@apple.com>
    243
  • branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp

    r286806 r286974  
    438438
    439439        if (deltas[axis][0] > 0)
    440             std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::greater<float>());
     440            std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::greater());
    441441        else
    442             std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::less<float>());
     442            std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]));
    443443    };
    444444
Note: See TracChangeset for help on using the changeset viewer.