diff options
author | Guido van Rossum <guido@python.org> | 1995-08-04 04:07:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-08-04 04:07:45 (GMT) |
commit | b7b45627e88756b06d37ef5f01dd48b5e0e1188c (patch) | |
tree | 251cbba6dbc743a932a1d174c5045fc70716e631 /Python/bltinmodule.c | |
parent | ac21f6a5797286e97136723a094f5b86070cde55 (diff) | |
download | cpython-b7b45627e88756b06d37ef5f01dd48b5e0e1188c.zip cpython-b7b45627e88756b06d37ef5f01dd48b5e0e1188c.tar.gz cpython-b7b45627e88756b06d37ef5f01dd48b5e0e1188c.tar.bz2 |
avoid resize of 0-length tuple
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 21562ae..9445255 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1527,6 +1527,11 @@ filtertuple(func, tuple) register int i, j; int len = gettuplesize(tuple); + if (len == 0) { + INCREF(tuple); + return tuple; + } + if ((result = newtupleobject(len)) == NULL) return NULL; |