[PATCH] simplify code
- From: Vincent Legoll <vincent legoll gmail com>
- To: meld-list gnome org
- Subject: [PATCH] simplify code
- Date: Tue, 3 Mar 2009 01:49:16 +0100
Remove the repeat() inline generator function, and
replace the code that was using it by a simpler
tuple multiplication, which better express the code
intent. I think.
This patch should be a noop.
Please review.
--
Vincent Legoll
Index: dirdiff.py
===================================================================
--- dirdiff.py (révision 1192)
+++ dirdiff.py (copie de travail)
@@ -416,10 +416,7 @@
self.items.extend(items)
def get(self):
self.items.sort()
- def repeat(s, n):
- for i in xrange(n):
- yield s
- return [ tuple(repeat(i,self.n)) for i in uniq(self.items) ]
+ return [(i,) * self.n for i in uniq(self.items)]
else:
canonicalize = lambda x : x.lower()
class accum(object):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]