From e1979df0cd7f20b1f106095a31624566ea6bcbbd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 3 Jul 2025 15:03:18 +0200 Subject: Cleanup: use a lambda. --- src/lib/shuffler.cc | 18 ++++++------------ 1 file 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 weak_piece, ContentVideo video) { @@ -71,7 +60,12 @@ Shuffler::video(weak_ptr 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) { -- cgit v1.2.3