summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-20 21:23:14 +0100
committerCarl Hetherington <cth@carlh.net>2022-01-24 15:59:44 +0100
commitb5a2f6308bfc49774b748235fa42ba84bb3bbe2f (patch)
tree9194386740227508b8c157741f0db4c7aab80ce0 /src
parentd55a89fd80f407f70037eff9fad63a2b5ddaa92a (diff)
Cleanup: use lambda.
Diffstat (limited to 'src')
-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 f6a3bdc7a..880826d44 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.frame != b.second.frame) {
- return a.second.frame < b.second.frame;
- }
- 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.frame != b.second.frame) {
+ return a.second.frame < b.second.frame;
+ }
+ return a.second.eyes < b.second.eyes;
+ });
while (true) {