Skip to content

Commit 95e4eec

Browse files
committed
Reduce the comments
1 parent c408c57 commit 95e4eec

File tree

1 file changed

+12
-39
lines changed

1 file changed

+12
-39
lines changed

Modules/arraymodule.c

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,7 @@ b_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
222222
if (!PyArg_Parse(v, "h;array item must be integer", &x))
223223
return -1;
224224

225-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
226-
* __index__ on v, which might modify the array buffer. See gh-142555.
227-
*/
225+
// Check buffer validity and bounds after call user-defined method.
228226
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
229227
PyErr_SetString(PyExc_IndexError,
230228
"array assignment index out of range");
@@ -261,9 +259,7 @@ BB_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
261259
if (!PyArg_Parse(v, "b;array item must be integer", &x))
262260
return -1;
263261

264-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
265-
* __index__ on v, which might modify the array buffer. See gh-142555.
266-
*/
262+
// Check buffer validity and bounds after call user-defined method.
267263
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
268264
PyErr_SetString(PyExc_IndexError,
269265
"array assignment index out of range");
@@ -363,9 +359,7 @@ h_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
363359
if (!PyArg_Parse(v, "h;array item must be integer", &x))
364360
return -1;
365361

366-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
367-
* __index__ on v, which might modify the array buffer. See gh-142555.
368-
*/
362+
// Check buffer validity and bounds after call user-defined method.
369363
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
370364
PyErr_SetString(PyExc_IndexError,
371365
"array assignment index out of range");
@@ -402,9 +396,7 @@ HH_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
402396
return -1;
403397
}
404398

405-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
406-
* __index__ on v, which might modify the array buffer. See gh-142555.
407-
*/
399+
// Check buffer validity and bounds after call user-defined method.
408400
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
409401
PyErr_SetString(PyExc_IndexError,
410402
"array assignment index out of range");
@@ -430,9 +422,7 @@ i_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
430422
if (!PyArg_Parse(v, "i;array item must be integer", &x))
431423
return -1;
432424

433-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
434-
* __index__ on v, which might modify the array buffer. See gh-142555.
435-
*/
425+
// Check buffer validity and bounds after call user-defined method.
436426
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
437427
PyErr_SetString(PyExc_IndexError,
438428
"array assignment index out of range");
@@ -480,10 +470,7 @@ II_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
480470
return -1;
481471
}
482472

483-
/* Check buffer validity and bounds after potential user code calls
484-
* (_PyNumber_Index and PyLong_AsUnsignedLong may modify the array buffer).
485-
* See gh-142555.
486-
*/
473+
// Check buffer validity and bounds after call user-defined method.
487474
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
488475
PyErr_SetString(PyExc_IndexError,
489476
"array assignment index out of range");
@@ -515,9 +502,7 @@ l_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
515502
if (!PyArg_Parse(v, "l;array item must be integer", &x))
516503
return -1;
517504

518-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
519-
* __index__ on v, which might modify the array buffer. See gh-142555.
520-
*/
505+
// Check buffer validity and bounds after call user-defined method.
521506
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
522507
PyErr_SetString(PyExc_IndexError,
523508
"array assignment index out of range");
@@ -556,10 +541,7 @@ LL_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
556541
return -1;
557542
}
558543

559-
/* Check buffer validity and bounds after potential user code calls
560-
* (_PyNumber_Index and PyLong_AsUnsignedLong may modify the array buffer).
561-
* See gh-142555.
562-
*/
544+
// Check buffer validity and bounds after call user-defined method.
563545
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
564546
PyErr_SetString(PyExc_IndexError,
565547
"array assignment index out of range");
@@ -591,9 +573,7 @@ q_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
591573
if (!PyArg_Parse(v, "L;array item must be integer", &x))
592574
return -1;
593575

594-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
595-
* __index__ on v, which might modify the array buffer. See gh-142555.
596-
*/
576+
// Check buffer validity and bounds after call user-defined method.
597577
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
598578
PyErr_SetString(PyExc_IndexError,
599579
"array assignment index out of range");
@@ -633,10 +613,7 @@ QQ_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
633613
return -1;
634614
}
635615

636-
/* Check buffer validity and bounds after potential user code calls
637-
* (_PyNumber_Index and PyLong_AsUnsignedLongLong may modify the array buffer).
638-
* See gh-142555.
639-
*/
616+
// Check buffer validity and bounds after call user-defined method.
640617
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
641618
PyErr_SetString(PyExc_IndexError,
642619
"array assignment index out of range");
@@ -668,9 +645,7 @@ f_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
668645
if (!PyArg_Parse(v, "f;array item must be float", &x))
669646
return -1;
670647

671-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
672-
* __index__ on v, which might modify the array buffer. See gh-142555.
673-
*/
648+
// Check buffer validity and bounds after call user-defined method.
674649
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
675650
PyErr_SetString(PyExc_IndexError,
676651
"array assignment index out of range");
@@ -695,9 +670,7 @@ d_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
695670
if (!PyArg_Parse(v, "d;array item must be float", &x))
696671
return -1;
697672

698-
/* Check buffer validity and bounds after PyArg_Parse which may call user-defined
699-
* __index__ on v, which might modify the array buffer. See gh-142555.
700-
*/
673+
// Check buffer validity and bounds after call user-defined method.
701674
if (i >= 0 && (ap->ob_item == NULL || i >= Py_SIZE(ap))) {
702675
PyErr_SetString(PyExc_IndexError,
703676
"array assignment index out of range");

0 commit comments

Comments
 (0)