summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-07-29 20:36:59 -0300
committerdrebs <drebs@leap.se>2016-08-01 21:09:04 -0300
commit027d0b5f40944973807e1a4fc497c496e78b3eeb (patch)
tree219ef4cff2bc3eca1b43c03270239dd447eecc45
parent1106d871e9a7e09cedac436a0488fc87af177b67 (diff)
[refactor] simplify couch whats_changed calculation
-rw-r--r--common/src/leap/soledad/common/couch/__init__.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/common/src/leap/soledad/common/couch/__init__.py b/common/src/leap/soledad/common/couch/__init__.py
index 2d57635a..9edbe380 100644
--- a/common/src/leap/soledad/common/couch/__init__.py
+++ b/common/src/leap/soledad/common/couch/__init__.py
@@ -623,12 +623,10 @@ class CouchDatabase(object):
cur_generation, last_trans_id = self.get_generation_info()
relevant_tail = self._get_transaction_log(start=old_generation + 1)
seen = set()
- generation = cur_generation
- for _, doc_id, trans_id in reversed(relevant_tail):
+ for generation, doc_id, trans_id in reversed(relevant_tail):
if doc_id not in seen:
changes.append((doc_id, generation, trans_id))
seen.add(doc_id)
- generation -= 1
changes.reverse()
return (cur_generation, last_trans_id, changes)