From a7e8d10969f280cd5a869b3525c3339357a958a6 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 18 Aug 2018 21:16:20 -0400 Subject: file_sys: Cut down on includes and copies --- src/core/crypto/key_manager.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/core/crypto/key_manager.h') diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h index 78d0b64e0..7a8728f76 100644 --- a/src/core/crypto/key_manager.h +++ b/src/core/crypto/key_manager.h @@ -74,9 +74,7 @@ struct KeyIndex { // boost flat_map requires operator< for O(log(n)) lookups. template bool operator<(const KeyIndex& lhs, const KeyIndex& rhs) { - return (static_cast(lhs.type) < static_cast(rhs.type)) || - (lhs.type == rhs.type && lhs.field1 < rhs.field1) || - (lhs.type == rhs.type && lhs.field1 == rhs.field1 && lhs.field2 < rhs.field2); + return std::tie(lhs.type, lhs.field1, lhs.field2) < std::tie(rhs.type, rhs.field1, rhs.field2); } class KeyManager { @@ -107,7 +105,7 @@ private: void AttemptLoadKeyFile(const std::string& dir1, const std::string& dir2, const std::string& filename, bool title); template - void WriteKeyToFile(bool title_key, std::string_view keyname, std::array key); + void WriteKeyToFile(bool title_key, std::string_view keyname, const std::array& key); static const boost::container::flat_map> s128_file_id; static const boost::container::flat_map> s256_file_id; -- cgit v1.2.3