[Python-checkins] cpython: Issue #26766: Remove redundant bytearray_format() from bytearrayobject.c

berker.peksag python-checkins at python.org
Fri Apr 15 18:19:48 EDT 2016


https://hg.python.org/cpython/rev/b3e3efc5afa4
changeset:   100991:b3e3efc5afa4
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Sat Apr 16 01:20:47 2016 +0300
summary:
  Issue #26766: Remove redundant bytearray_format() from bytearrayobject.c

files:
  Objects/bytearrayobject.c |  15 +--------------
  1 files changed, 1 insertions(+), 14 deletions(-)


diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -279,19 +279,6 @@
     return (PyObject *)result;
 }
 
-static PyObject *
-bytearray_format(PyByteArrayObject *self, PyObject *args)
-{
-    if (self == NULL || !PyByteArray_Check(self)) {
-        PyErr_BadInternalCall();
-        return NULL;
-    }
-
-    return _PyBytes_FormatEx(PyByteArray_AS_STRING(self),
-                             PyByteArray_GET_SIZE(self),
-                             args, 1);
-}
-
 /* Functions stuffed into the type object */
 
 static Py_ssize_t
@@ -3014,7 +3001,7 @@
 {
     if (!PyByteArray_Check(v))
         Py_RETURN_NOTIMPLEMENTED;
-    return bytearray_format((PyByteArrayObject *)v, w);
+    return _PyBytes_FormatEx(PyByteArray_AS_STRING(v), PyByteArray_GET_SIZE(v), w, 1);
 }
 
 static PyNumberMethods bytearray_as_number = {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list