summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-10 16:14:24 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-10 16:14:24 +0200
commitb064eb34aac74f2e16013aff867bd5f831b7bcc0 (patch)
tree8cba368117ae434d270b8bdb3911c42a62660c2a
parentRemove db bottleneck by caching ro txn for 100 requests (diff)
downloadnheko-b064eb34aac74f2e16013aff867bd5f831b7bcc0.tar.xz
Fix lint
-rw-r--r--src/Cache.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 684883e4..963842cd 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -793,7 +793,6 @@ Cache::isInitialized()
 
         bool res = syncStateDb_.get(txn, NEXT_BATCH_KEY, token);
 
-
         return res;
 }
 
@@ -808,7 +807,6 @@ Cache::nextBatchToken()
 
         bool result = syncStateDb_.get(txn, NEXT_BATCH_KEY, token);
 
-
         if (result)
                 return std::string(token.data(), token.size());
         else
@@ -1187,14 +1185,14 @@ Cache::calculateRoomReadStatus(const std::string &room_id)
                         }
                 }
 
-        if (last_event_id.empty() || fullyReadEventId.empty())
-                return true;
+                if (last_event_id.empty() || fullyReadEventId.empty())
+                        return true;
 
-        if (last_event_id == fullyReadEventId)
-                return false;
+                if (last_event_id == fullyReadEventId)
+                        return false;
 
-        last_event_id_    = std::string(last_event_id);
-        fullyReadEventId_ = std::string(fullyReadEventId);
+                last_event_id_    = std::string(last_event_id);
+                fullyReadEventId_ = std::string(fullyReadEventId);
         }
 
         // Retrieve all read receipts for that event.
@@ -1527,7 +1525,6 @@ Cache::singleRoomInfo(const std::string &room_id)
                         tmp.join_rule    = getRoomJoinRule(txn, statesdb);
                         tmp.guest_access = getRoomGuestAccess(txn, statesdb);
 
-
                         return tmp;
                 } catch (const json::exception &e) {
                         nhlog::db()->warn("failed to parse room info: room_id ({}), {}: {}",
@@ -1537,7 +1534,6 @@ Cache::singleRoomInfo(const std::string &room_id)
                 }
         }
 
-
         return RoomInfo();
 }