Skip to content

Commit b26fbb8

Browse files
pedramkarimiipedramkarimii
authored andcommitted
gh-151640: simplify BytesIO exports checks
1 parent 4bd5bda commit b26fbb8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_io/bytesio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ _io_BytesIO_getvalue_impl(bytesio *self)
375375
return PyBytes_FromStringAndSize(PyBytes_AS_STRING(self->buf),
376376
self->string_size);
377377
#else
378-
if (self->string_size <= 1 || FT_ATOMIC_LOAD_SSIZE_RELAXED(self->exports) > 0)
378+
if (self->string_size <= 1 || self->exports > 0)
379379
return PyBytes_FromStringAndSize(PyBytes_AS_STRING(self->buf),
380380
self->string_size);
381381

@@ -438,7 +438,7 @@ peek_bytes_lock_held(bytesio *self, Py_ssize_t size)
438438
#ifndef Py_GIL_DISABLED
439439
if (size > 1 &&
440440
self->pos == 0 && size == PyBytes_GET_SIZE(self->buf) &&
441-
FT_ATOMIC_LOAD_SSIZE_RELAXED(self->exports) == 0) {
441+
self->exports == 0) {
442442
return Py_NewRef(self->buf);
443443
}
444444
#endif

0 commit comments

Comments
 (0)