aboutsummaryrefslogtreecommitdiff
path: root/lib/events/accountdataevents.h
diff options
context:
space:
mode:
authorBlack Hat <bhat@encom.eu.org>2019-12-29 21:42:10 +0800
committerBlack Hat <bhat@encom.eu.org>2019-12-29 21:42:10 +0800
commit7d55e22ee3465e75e5ac7750bb1d205eb555761d (patch)
tree36f7fcef622c44aca8d46514395126280111ed8a /lib/events/accountdataevents.h
parente0c01b6fee5027211bd44a39860e40a2b7b226ad (diff)
parent16d6700950f5f0ebd71481efd5e1a24f04e3c651 (diff)
downloadlibquotient-7d55e22ee3465e75e5ac7750bb1d205eb555761d.tar.gz
libquotient-7d55e22ee3465e75e5ac7750bb1d205eb555761d.zip
Merge branch 'master' of https://github.com/quotient-im/libQuotient into bhat-powerlevel
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);
}
};