From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 10 Sep 2019 17:46:52 +0000 (-0700) Subject: Remove unneeded assignment in PyBytes_Concat() (GH-15274) X-Git-Tag: v3.8.0rc1~210 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98224d24d1d69383ccc6336e87e362f986c99169;p=python 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 --- diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 06c87b0c62..9358e5effd 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);