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

Changeset 286858 in webkit


Ignore:
Timestamp:
Dec 10, 2021, 10:17:47 AM (5 years ago)
Author:
Darin Adler
Message:

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.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r286849 r286858  
     12021-12-09  Darin Adler  <darin@apple.com>
     2
     3        Use simpler idioms for std::less and std::greater possible in modern C++
     4        https://bugs.webkit.org/show_bug.cgi?id=234117
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * wtf/ListDump.h:
     9        (WTF::sortedListDump): Removed unnecessary template arguments to std::less.
     10
    1112021-12-10  Keith Miller  <keith_miller@apple.com>
    212
  • trunk/Source/WTF/wtf/ListDump.h

    r237099 r286858  
    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
  • trunk/Source/WebCore/ChangeLog

    r286857 r286858  
     12021-12-09  Darin Adler  <darin@apple.com>
     2
     3        Use simpler idioms for std::less and std::greater possible in modern C++
     4        https://bugs.webkit.org/show_bug.cgi?id=234117
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * testing/InternalsMapLike.cpp:
     9        (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit
     10        use of std:less, because this is what std::sort by default.
     11
    1122021-12-10  Commit Queue  <commit-queue@webkit.org>
    213
  • trunk/Source/WebCore/testing/InternalsMapLike.cpp

    r253276 r286858  
    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}
  • trunk/Source/WebKit/ChangeLog

    r286852 r286858  
     12021-12-09  Darin Adler  <darin@apple.com>
     2
     3        Use simpler idioms for std::less and std::greater possible in modern C++
     4        https://bugs.webkit.org/show_bug.cgi?id=234117
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     9        (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded
     10        template arguments for std::greater, and removed explicit use of std::less,
     11        since that's what std::sort does by default.
     12
    1132021-12-10  Per Arne Vollan  <pvollan@apple.com>
    214
  • trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp

    r286805 r286858  
    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.