Commit e7997255 authored by Tim Peters's avatar Tim Peters

multiunion(): Don't bother with bucket_append() when an input set/bucket

is empty.
parent 2fa3cf66
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
Set operations Set operations
****************************************************************************/ ****************************************************************************/
#define SETOPTEMPLATE_C "$Id: SetOpTemplate.c,v 1.28 2002/06/27 22:09:32 tim_one Exp $\n" #define SETOPTEMPLATE_C "$Id: SetOpTemplate.c,v 1.29 2002/06/27 22:24:16 tim_one Exp $\n"
#ifdef INTSET_H #ifdef INTSET_H
static int static int
...@@ -508,10 +508,11 @@ multiunion_m(PyObject *ignored, PyObject *args) ...@@ -508,10 +508,11 @@ multiunion_m(PyObject *ignored, PyObject *args)
set->ob_type == (PyTypeObject*)&BucketType) set->ob_type == (PyTypeObject*)&BucketType)
{ {
Bucket *b = BUCKET(set); Bucket *b = BUCKET(set);
int status; int status = 0;
UNLESS (PER_USE(b)) goto Error; UNLESS (PER_USE(b)) goto Error;
status = bucket_append(result, b, 0, b->len, 0, i < n-1); if (b->len)
status = bucket_append(result, b, 0, b->len, 0, i < n-1);
PER_UNUSE(b); PER_UNUSE(b);
if (status < 0) goto Error; if (status < 0) goto Error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment