- Revision
- 286974
- Author
- alanc...@apple.com
- Date
- 2021-12-13 12:56:53 -0800 (Mon, 13 Dec 2021)
Log 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
Modified Paths
Diff
Modified: branches/safari-612-branch/Source/WTF/ChangeLog (286973 => 286974)
--- branches/safari-612-branch/Source/WTF/ChangeLog 2021-12-13 20:56:48 UTC (rev 286973)
+++ branches/safari-612-branch/Source/WTF/ChangeLog 2021-12-13 20:56:53 UTC (rev 286974)
@@ -1,3 +1,42 @@
+2021-12-13 Alan Coon <alanc...@apple.com>
+
+ 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
+
+ 2021-12-09 Darin Adler <da...@apple.com>
+
+ 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.
+
+ * wtf/ListDump.h:
+ (WTF::sortedListDump): Removed unnecessary template arguments to std::less.
+
2021-12-06 Alan Coon <alanc...@apple.com>
Cherry-pick r286537. rdar://problem/85928816
Modified: branches/safari-612-branch/Source/WTF/wtf/ListDump.h (286973 => 286974)
--- branches/safari-612-branch/Source/WTF/wtf/ListDump.h 2021-12-13 20:56:48 UTC (rev 286973)
+++ branches/safari-612-branch/Source/WTF/wtf/ListDump.h 2021-12-13 20:56:53 UTC (rev 286974)
@@ -121,7 +121,7 @@
template<typename T>
CString sortedListDump(const T& list, const char* comma = ", ")
{
- return sortedListDump(list, std::less<typename T::ValueType>(), comma);
+ return sortedListDump(list, std::less<>(), comma);
}
template<typename T>
Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (286973 => 286974)
--- branches/safari-612-branch/Source/WebCore/ChangeLog 2021-12-13 20:56:48 UTC (rev 286973)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog 2021-12-13 20:56:53 UTC (rev 286974)
@@ -1,3 +1,43 @@
+2021-12-13 Alan Coon <alanc...@apple.com>
+
+ 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
+
+ 2021-12-09 Darin Adler <da...@apple.com>
+
+ 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.
+
+ * testing/InternalsMapLike.cpp:
+ (WebCore::InternalsMapLike::inspectValues const): Remove unneeded explicit
+ use of std:less, because this is what std::sort by default.
+
2021-12-09 Alan Coon <alanc...@apple.com>
Apply patch. rdar://problem/86235842
Modified: branches/safari-612-branch/Source/WebCore/testing/InternalsMapLike.cpp (286973 => 286974)
--- branches/safari-612-branch/Source/WebCore/testing/InternalsMapLike.cpp 2021-12-13 20:56:48 UTC (rev 286973)
+++ branches/safari-612-branch/Source/WebCore/testing/InternalsMapLike.cpp 2021-12-13 20:56:53 UTC (rev 286974)
@@ -68,7 +68,7 @@
Vector<unsigned> InternalsMapLike::inspectValues() const
{
auto result = copyToVector(m_values.values());
- std::sort(result.begin(), result.end(), std::less<unsigned>());
+ std::sort(result.begin(), result.end());
return result;
}
Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (286973 => 286974)
--- branches/safari-612-branch/Source/WebKit/ChangeLog 2021-12-13 20:56:48 UTC (rev 286973)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog 2021-12-13 20:56:53 UTC (rev 286974)
@@ -1,5 +1,46 @@
2021-12-13 Alan Coon <alanc...@apple.com>
+ 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
+
+ 2021-12-09 Darin Adler <da...@apple.com>
+
+ 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.
+
+ * 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.
+
+2021-12-13 Alan Coon <alanc...@apple.com>
+
Cherry-pick r286900. rdar://problem/86344954
Momentum Event Dispatcher: Magic Mouse doesn't use momentum event dispatcher
Modified: branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (286973 => 286974)
--- branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp 2021-12-13 20:56:48 UTC (rev 286973)
+++ branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp 2021-12-13 20:56:53 UTC (rev 286974)
@@ -437,9 +437,9 @@
return;
if (deltas[axis][0] > 0)
- std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::greater<float>());
+ std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::greater());
else
- std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::less<float>());
+ std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]));
};
sortDeltas(Horizontal);