[Python-checkins] Remove unneeded assignment in PyBytes_Concat() (GH-15274)

Gregory P. Smith webhook-mailer at python.org
Tue Sep 10 12:11:14 EDT 2019


https://github.com/python/cpython/commit/afdeb189e97033b54cef44a7490d89d2013cb4e5
commit: afdeb189e97033b54cef44a7490d89d2013cb4e5
branch: master
author: Sergey Fedoseev <fedoseev.sergey at gmail.com>
committer: Gregory P. Smith <greg at krypto.org>
date: 2019-09-10T17:11:10+01:00
summary:

Remove unneeded assignment in PyBytes_Concat() (GH-15274)

The `wb.len = -1` assignment is unneeded since its introduction in 161d695fb0455ce52530d4f43a9eac4c738f64bb as `PyObject_GetBuffer` always fills it in.

files:
M Objects/bytesobject.c

diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 72f9cd271be0..e1f5ee2f62f3 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2935,7 +2935,6 @@ PyBytes_Concat(PyObject **pv, PyObject *w)
         Py_ssize_t oldsize;
         Py_buffer wb;
 
-        wb.len = -1;
         if (PyObject_GetBuffer(w, &wb, PyBUF_SIMPLE) != 0) {
             PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
                          Py_TYPE(w)->tp_name, Py_TYPE(*pv)->tp_name);



More information about the Python-checkins mailing list