Merge lp:~ben-a/u1db/fixes--1262956 into lp:u1db

Proposed by B Carrillo
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~ben-a/u1db/fixes--1262956
Merge into: lp:u1db
Diff against target: 17 lines (+3/-4)
1 file modified
u1db/sync.py (+3/-4)
To merge this branch: bzr merge lp:~ben-a/u1db/fixes--1262956
Reviewer Review Type Date Requested Status
dobey (community) Needs Fixing
Review via email: mp+199739@code.launchpad.net

Description of the change

avoids double iteration

To post a comment you must log in.
lp:~ben-a/u1db/fixes--1262956 updated
444. By B Carrillo

Avoid double iteration

Revision history for this message
dobey (dobey) wrote :

This change results in 25 tests failing. You can run the tests with: (mkdir -p build && cd build && cmake .. && make check)

These tests will have to not fail, and it would be nice if there were a way to test this specific change as well.

review: Needs Fixing
Revision history for this message
dobey (dobey) wrote :

A month with no replies, so rejecting this.

Unmerged revisions

444. By B Carrillo

Avoid double iteration

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'u1db/sync.py'
2--- u1db/sync.py 2012-10-09 17:00:12 +0000
3+++ u1db/sync.py 2013-12-20 03:49:42 +0000
4@@ -134,10 +134,9 @@
5 # prepare to send all the changed docs
6 docs_to_send = self.source.get_docs(changed_doc_ids,
7 check_for_conflicts=False, include_deleted=True)
8- # TODO: there must be a way to not iterate twice
9- docs_by_generation = zip(
10- docs_to_send, (gen for _, gen, _ in changes),
11- (trans for _, _, trans in changes))
12+ docs_by_generation = (
13+ (doc, gen, trans)
14+ for (doc, (_, gen, trans)) in zip(docs_to_send, changes))
15
16 # exchange documents and try to insert the returned ones with
17 # the target, return target synced-up-to gen

Subscribers

People subscribed via source and target branches