Skip to content

Commit 15cf615

Browse files
committed
gh-151640: simplify BytesIO exports checks
1 parent 918fb1c commit 15cf615

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

@@ -437,7 +437,7 @@ read_bytes_lock_held(bytesio *self, Py_ssize_t size)
437437
#ifndef Py_GIL_DISABLED
438438
if (size > 1 &&
439439
self->pos == 0 && size == PyBytes_GET_SIZE(self->buf) &&
440-
FT_ATOMIC_LOAD_SSIZE_RELAXED(self->exports) == 0) {
440+
self->exports == 0) {
441441
self->pos += size;
442442
return Py_NewRef(self->buf);
443443
}

0 commit comments

Comments
 (0)