commit | a84f3abb9ed70a0b13181698fd8c270dd4abbb88 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Sun Sep 12 19:53:07 2004 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Sun Sep 12 19:53:07 2004 +0000 |
tree | 7cbcb9c7c76b73e54751dc52704dd48fe5f67d09 | |
parent | 0e9980f75a203ee1b2ac28f76a76239446b271d6 [diff] |
SF #1022910: Conserve memory with list.pop() The list resizing scheme only downsized when more than 16 elements were removed in a single step: del a[100:120]. As a result, the list would never shrink when popping elements off one at a time. This patch makes it shrink whenever more than half of the space is unused. Also, at Tim's suggestion, renamed _new_size to new_allocated. This makes the code easier to understand.