aboutsummaryrefslogtreecommitdiff
path: root/lib/events/accountdataevents.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-11-01 09:43:41 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-11-01 09:43:41 +0900
commitfd3d6812a6a9c89c7ea4872defc4dd8dec2b19ed (patch)
tree4bb8be8e6ee370d943516c9ba197fb12c8377ea8 /lib/events/accountdataevents.h
parent8a574f8727cc8b1c91acf0840e99c9382c289098 (diff)
parentedbbc2bc77599ead0e14bc08cdddda10d1c5f305 (diff)
downloadlibquotient-fd3d6812a6a9c89c7ea4872defc4dd8dec2b19ed.tar.gz
libquotient-fd3d6812a6a9c89c7ea4872defc4dd8dec2b19ed.zip
Merge branch 'kitsune-std-optional'
Diffstat (limited to 'lib/events/accountdataevents.h')
-rw-r--r--lib/events/accountdataevents.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/events/accountdataevents.h b/lib/events/accountdataevents.h
index 31176766..a55016d9 100644
--- a/lib/events/accountdataevents.h
+++ b/lib/events/accountdataevents.h
@@ -1,5 +1,3 @@
-#include <utility>
-
/******************************************************************************
* Copyright (C) 2018 Kitsune Ral <kitsune-ral@users.sf.net>
*
@@ -34,13 +32,13 @@ struct TagRecord {
order_type order;
- TagRecord(order_type order = none) : order(order) {}
+ TagRecord(order_type order = none) : order(std::move(order)) {}
bool operator<(const TagRecord& other) const
{
- // Per The Spec, rooms with no order should be after those with order
- return !order.omitted()
- && (other.order.omitted() || order.value() < other.order.value());
+ // Per The Spec, rooms with no order should be after those with order,
+ // against optional<>::operator<() convention.
+ return order && (!other.order || *order < *other.order);
}
};