]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
* Moved the responsibility for emptying the previous list from list_fill
authorRaymond Hettinger <python@rcn.com>
Sun, 15 Feb 2004 04:06:39 +0000 (04:06 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 15 Feb 2004 04:06:39 +0000 (04:06 +0000)
commitfa7b9d8255e2bb5705de82468ff5ff1dc001e5e9
tree364ab1416f00931bf6aa04590c1842d5328b7fb4
parent90a39bf12c96c47a45c9b7ce3b10f3a3817bd5ac
* Moved the responsibility for emptying the previous list from list_fill
  to list_init.

* Replaced the code in list_extend with the superior code from list_fill.

* Eliminated list_fill.

Results:

* list.extend() no longer creates an intermediate tuple except to handle
  the special case of x.extend(x).  The saves memory and time.

* list.extend(x) runs
    about the same x is a list or tuple,
    a little faster when x is an iterable not defining __len__, and
    twice as fast when x is an iterable defining __len__.

* the code is about 15 lines shorter and no longer duplicates
  functionality.
Misc/NEWS