[IMP] replace range by xrange to avoid to build the full list when an anticipated break may stop the iteration

This commit is contained in:
Guewen Baconnier
2013-01-03 16:06:19 +01:00
parent 374df2cebd
commit 9943a685ae

View File

@@ -41,7 +41,7 @@ class easy_reconcile_simple(AbstractModel):
count = 0
res = []
while (count < len(lines)):
for i in range(count+1, len(lines)):
for i in xrange(count+1, len(lines)):
writeoff_account_id = False
if lines[count][self._key_field] != lines[i][self._key_field]:
break