Skip to content

Commit 518d5c5

Browse files
committed
remove unnecessary critical sections
1 parent 4626f8f commit 518d5c5

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Objects/bytearrayobject.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "pycore_bytes_methods.h"
66
#include "pycore_bytesobject.h"
77
#include "pycore_ceval.h" // _PyEval_GetBuiltin()
8-
#include "pycore_critical_section.h"
98
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
109
#include "pycore_strhex.h" // _Py_strhex_with_sep()
1110
#include "pycore_long.h" // _PyLong_FromUnsignedChar()
@@ -2530,14 +2529,12 @@ bytearrayiter_next(PyObject *self)
25302529
PyByteArrayObject *seq = it->it_seq;
25312530
assert(PyByteArray_Check(seq));
25322531

2533-
Py_BEGIN_CRITICAL_SECTION(seq);
25342532
if (index < PyByteArray_GET_SIZE(seq)) {
25352533
val = (unsigned char)PyByteArray_AS_STRING(seq)[index];
25362534
}
25372535
else {
25382536
val = -1;
25392537
}
2540-
Py_END_CRITICAL_SECTION();
25412538

25422539
if (val == -1) {
25432540
FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, -1);
@@ -2581,11 +2578,9 @@ bytearrayiter_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
25812578
PyObject *ret = NULL;
25822579
Py_ssize_t index = FT_ATOMIC_LOAD_SSIZE_RELAXED(it->it_index);
25832580
if (index >= 0) {
2584-
Py_BEGIN_CRITICAL_SECTION(it->it_seq);
25852581
if (index <= PyByteArray_GET_SIZE(it->it_seq)) {
25862582
ret = Py_BuildValue("N(O)n", iter, it->it_seq, index);
25872583
}
2588-
Py_END_CRITICAL_SECTION();
25892584
}
25902585
if (ret == NULL) {
25912586
ret = Py_BuildValue("N(())", iter);

0 commit comments

Comments
 (0)