Skip to content

Commit 3132830

Browse files
committed
Refactor condition in index_deltas() #62
Signed-off-by: John M. Horan <johnmhoran@gmail.com>
1 parent 1b11fec commit 3132830

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/deltacode/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,7 @@ def index_deltas(self, index_key='path', delta_list=[]):
224224
index = {}
225225

226226
for delta in delta_list:
227-
# FIXME: This is an ugly way to do this.
228-
if delta.score == 10:
229-
key = getattr(delta.old_file, index_key)
230-
else:
231-
key = getattr(delta.new_file, index_key)
227+
key = getattr(delta.new_file if delta.new_file else delta.old_file, index_key)
232228

233229
if index.get(key) is None:
234230
index[key] = []

0 commit comments

Comments
 (0)