This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Remove a redundant check in _PyBytes_Resize()
Type: Stage: resolved
Components: Versions: Python 3.10
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: malin
Priority: normal Keywords: patch

Created on 2021-01-25 13:14 by malin, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24330 closed malin, 2021-01-25 13:16
Messages (2)
msg385626 - (view) Author: Ma Lin (malin) * Date: 2021-01-25 13:14
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;
    }
msg385628 - (view) Author: Ma Lin (malin) * Date: 2021-01-25 13:37
Found a new issue, can be combined with this issue.
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87189
2021-01-25 13:37:04malinsetstatus: open -> closed

messages: + msg385628
stage: patch review -> resolved
2021-01-25 13:16:09malinsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23149
2021-01-25 13:14:36malincreate