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

Miss Islington (bot) webhook-mailer at python.org
Tue Sep 10 13:46:58 EDT 2019


https://github.com/python/cpython/commit/98224d24d1d69383ccc6336e87e362f986c99169
commit: 98224d24d1d69383ccc6336e87e362f986c99169
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-09-10T10:46:52-07: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.
(cherry picked from commit afdeb189e97033b54cef44a7490d89d2013cb4e5)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey at gmail.com>

files:
M Objects/bytesobject.c

diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 06c87b0c62d3..9358e5effd56 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2939,7 +2939,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