diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-25 00:25:30 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-25 00:25:30 (GMT) |
commit | 5a04aec384c6d8346ee31396aad08b75421efae5 (patch) | |
tree | de10182bea85a933560b84e788dc229c3d47ddc9 /Objects/bufferobject.c | |
parent | 17031bf421b21ae8b792d2b04c0ad5f997244865 (diff) | |
download | cpython-5a04aec384c6d8346ee31396aad08b75421efae5.zip cpython-5a04aec384c6d8346ee31396aad08b75421efae5.tar.gz cpython-5a04aec384c6d8346ee31396aad08b75421efae5.tar.bz2 |
Fix SF bug 546434 -- buffer slice type inconsistent.
Diffstat (limited to 'Objects/bufferobject.c')
-rw-r--r-- | Objects/bufferobject.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c index 031c000..690f56b 100644 --- a/Objects/bufferobject.c +++ b/Objects/bufferobject.c @@ -296,13 +296,6 @@ buffer_concat(PyBufferObject *self, PyObject *other) if ( (count = (*pb->bf_getreadbuffer)(other, 0, &p2)) < 0 ) return NULL; - /* optimize special case */ - if ( count == 0 ) - { - Py_INCREF(self); - return (PyObject *)self; - } - ob = PyString_FromStringAndSize(NULL, self->b_size + count); p1 = PyString_AS_STRING(ob); memcpy(p1, self->b_ptr, self->b_size); @@ -361,12 +354,6 @@ buffer_slice(PyBufferObject *self, int left, int right) right = 0; if ( right > self->b_size ) right = self->b_size; - if ( left == 0 && right == self->b_size ) - { - /* same as self */ - Py_INCREF(self); - return (PyObject *)self; - } if ( right < left ) right = left; return PyString_FromStringAndSize((char *)self->b_ptr + left, |