- Revision
- 286858
- Author
- da...@apple.com
- Date
- 2021-12-10 10:17:47 -0800 (Fri, 10 Dec 2021)
Log 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.
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (286857 => 286858)
--- trunk/Source/WTF/ChangeLog 2021-12-10 17:28:10 UTC (rev 286857)
+++ trunk/Source/WTF/ChangeLog 2021-12-10 18:17:47 UTC (rev 286858)
@@ -1,3 +1,13 @@
+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-10 Keith Miller <keith_mil...@apple.com>
Reduce maximum mmap size for Structure regions to help placate ios
Modified: trunk/Source/WTF/wtf/ListDump.h (286857 => 286858)
--- trunk/Source/WTF/wtf/ListDump.h 2021-12-10 17:28:10 UTC (rev 286857)
+++ trunk/Source/WTF/wtf/ListDump.h 2021-12-10 18:17:47 UTC (rev 286858)
@@ -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: trunk/Source/WebCore/ChangeLog (286857 => 286858)
--- trunk/Source/WebCore/ChangeLog 2021-12-10 17:28:10 UTC (rev 286857)
+++ trunk/Source/WebCore/ChangeLog 2021-12-10 18:17:47 UTC (rev 286858)
@@ -1,3 +1,14 @@
+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-10 Commit Queue <commit-qu...@webkit.org>
Unreviewed, reverting r286836.
Modified: trunk/Source/WebCore/testing/InternalsMapLike.cpp (286857 => 286858)
--- trunk/Source/WebCore/testing/InternalsMapLike.cpp 2021-12-10 17:28:10 UTC (rev 286857)
+++ trunk/Source/WebCore/testing/InternalsMapLike.cpp 2021-12-10 18:17:47 UTC (rev 286858)
@@ -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: trunk/Source/WebKit/ChangeLog (286857 => 286858)
--- trunk/Source/WebKit/ChangeLog 2021-12-10 17:28:10 UTC (rev 286857)
+++ trunk/Source/WebKit/ChangeLog 2021-12-10 18:17:47 UTC (rev 286858)
@@ -1,3 +1,15 @@
+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-10 Per Arne Vollan <pvol...@apple.com>
Fix sandbox build error
Modified: trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (286857 => 286858)
--- trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp 2021-12-10 17:28:10 UTC (rev 286857)
+++ trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp 2021-12-10 18:17:47 UTC (rev 286858)
@@ -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);