[PATCH] ui: remove redundant list

Matt Mackall mpm at selenic.com
Sat Apr 9 16:06:46 CDT 2011


On Sat, 2011-04-09 at 23:54 +0300, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1302382390 -10800
> # Node ID 36a2b3ffdd067917fc8e0a2da94d3567270058a3
> # Parent  8f81d6f4047fedc325dc0ff7ba507188d7b9d67d
> ui: remove redundant list

..except the current way is significantly faster:

$ python -m timeit -s 'a = []' -c 'a.extend(x for x in xrange(1000))'
10000 loops, best of 3: 167 usec per loop
$ python -m timeit -s 'a = []' -c 'a.extend([x for x in xrange(1000)])'
10000 loops, best of 3: 105 usec per loop

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list