Skip to content

Commit 2a1c0a8

Browse files
committed
gh-129813: Fix typo in byteswriter_resize()
The intent is to test "resize and overallocate", even if in practice "resize & overallocate" is the same (both variables are either 0 or 1). Use "&&" to better describe the intent of the test.
1 parent aaae15c commit 2a1c0a8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/bytesobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3629,7 +3629,7 @@ byteswriter_resize(PyBytesWriter *writer, Py_ssize_t size, int resize)
36293629
return 0;
36303630
}
36313631

3632-
if (resize & writer->overallocate) {
3632+
if (resize && writer->overallocate) {
36333633
if (size <= (PY_SSIZE_T_MAX - size / OVERALLOCATE_FACTOR)) {
36343634
size += size / OVERALLOCATE_FACTOR;
36353635
}

0 commit comments

Comments
 (0)