summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-08-04 04:07:45 (GMT)
committerGuido van Rossum <guido@python.org>1995-08-04 04:07:45 (GMT)
commitb7b45627e88756b06d37ef5f01dd48b5e0e1188c (patch)
tree251cbba6dbc743a932a1d174c5045fc70716e631 /Python
parentac21f6a5797286e97136723a094f5b86070cde55 (diff)
downloadcpython-b7b45627e88756b06d37ef5f01dd48b5e0e1188c.zip
cpython-b7b45627e88756b06d37ef5f01dd48b5e0e1188c.tar.gz
cpython-b7b45627e88756b06d37ef5f01dd48b5e0e1188c.tar.bz2
avoid resize of 0-length tuple
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c5
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;