From b2b9cccb5e3f28f7863f03ccc3da8af226e6e650 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 4 Dec 2021 04:39:09 +0100 Subject: Fix a few clang tidy warnings --- src/Cache.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Cache.cpp') diff --git a/src/Cache.cpp b/src/Cache.cpp index 4f96f430..f22afc7f 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -1857,16 +1857,12 @@ Cache::getTimelineMessages(lmdb::txn &txn, const std::string &room_id, uint64_t auto cursor = lmdb::cursor::open(txn, orderDb); if (index == std::numeric_limits::max()) { - if (cursor.get(indexVal, event_id, forward ? MDB_FIRST : MDB_LAST)) { - index = lmdb::from_sv(indexVal); - } else { + if (!cursor.get(indexVal, event_id, forward ? MDB_FIRST : MDB_LAST)) { messages.end_of_cache = true; return messages; } } else { - if (cursor.get(indexVal, event_id, MDB_SET)) { - index = lmdb::from_sv(indexVal); - } else { + if (!cursor.get(indexVal, event_id, MDB_SET)) { messages.end_of_cache = true; return messages; } -- cgit 1.5.1