[issue43023] Remove a redundant check in _PyBytes_Resize()

2021-01-25 Thread Ma Lin


Ma Lin  added the comment:

Found a new issue, can be combined with this issue.

--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43023] Remove a redundant check in _PyBytes_Resize()

2021-01-25 Thread Ma Lin


Change by Ma Lin :


--
keywords: +patch
pull_requests: +23149
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24330

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43023] Remove a redundant check in _PyBytes_Resize()

2021-01-25 Thread Ma Lin


New submission from Ma Lin :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com