summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-03 15:03:18 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-03 15:03:18 +0200
commite1979df0cd7f20b1f106095a31624566ea6bcbbd (patch)
tree7f55f29b6b9bc94c02afcb4faa27117f71699ce6
parent845927c9674907a772fabe6110a2a4e02e73fbcd (diff)
Cleanup: use a lambda.
-rw-r--r--src/lib/shuffler.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/shuffler.cc b/src/lib/shuffler.cc
index 9ce24e3d5..57c17ad46 100644
--- a/src/lib/shuffler.cc
+++ b/src/lib/shuffler.cc
@@ -37,17 +37,6 @@ using boost::optional;
int const Shuffler::_max_size = 64;
-struct Comparator
-{
- bool operator()(Shuffler::Store const & a, Shuffler::Store const & b) {
- if (a.second.time != b.second.time) {
- return a.second.time < b.second.time;
- }
- return a.second.eyes < b.second.eyes;
- }
-};
-
-
void
Shuffler::video(weak_ptr<Piece> weak_piece, ContentVideo video)
{
@@ -71,7 +60,12 @@ Shuffler::video(weak_ptr<Piece> weak_piece, ContentVideo video)
}
_store.push_back(make_pair(weak_piece, video));
- _store.sort(Comparator());
+ _store.sort([](Shuffler::Store const& a, Shuffler::Store const& b) {
+ if (a.second.time != b.second.time) {
+ return a.second.time < b.second.time;
+ }
+ return a.second.eyes < b.second.eyes;
+ });
while (true) {