summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2021-11-23 00:39:59 +0100
committerJoel Klinghed <the_jk@spawned.biz>2021-11-23 00:39:59 +0100
commit29dbb89fcec55d24bc3bfff0aee6254d1db756e4 (patch)
tree962fa0cb2739cae801b9abbae545b95b9ee444f4
parent4f00b3eb286104b9d9ca93f502cc71b52ad63d97 (diff)
Sort trips by year
-rw-r--r--src/travel.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/travel.cc b/src/travel.cc
index 6b3feb2..3f95757 100644
--- a/src/travel.cc
+++ b/src/travel.cc
@@ -448,6 +448,13 @@ private:
void finder_done() {
finder_.reset();
+ std::sort(trips_.begin(), trips_.end(),
+ [] (TripImpl const& a, TripImpl const& b) {
+ if (a.year() == b.year())
+ return a.title() < b.title();
+ return a.year() < b.year();
+ });
+
for (auto& trip_impl : trips_)
cleanup_trip(trip_impl);