[New-bugs-announce] [issue43023] Remove a redundant check in _PyBytes_Resize()

Ma Lin report at bugs.python.org
Mon Jan 25 08:14:36 EST 2021


New submission from Ma Lin <malincns at 163.com>:

Above code already cover this check:

    if (Py_SIZE(v) == newsize) {
        /* return early if newsize equals to v->ob_size */
        return 0;
    }
    if (Py_SIZE(v) == 0) {
-       if (newsize == 0) {
-           return 0;
-       }
        *pv = _PyBytes_FromSize(newsize, 0);
        Py_DECREF(v);
        return (*pv == NULL) ? -1 : 0;
    }

----------
messages: 385626
nosy: malin
priority: normal
severity: normal
status: open
title: Remove a redundant check in _PyBytes_Resize()
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43023>
_______________________________________


More information about the New-bugs-announce mailing list