Skip to content

Commit 9504b13

Browse files
committed
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
1 parent a6be61e commit 9504b13

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Modules/arraymodule.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ array_fromunicode(arrayobject *self, PyObject *args)
14611461
if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n))
14621462
return NULL;
14631463
typecode = self->ob_descr->typecode;
1464-
if ((typecode != 'u')) {
1464+
if (typecode != 'u') {
14651465
PyErr_SetString(PyExc_ValueError,
14661466
"fromunicode() may only be called on "
14671467
"unicode type arrays");
@@ -1493,7 +1493,7 @@ array_tounicode(arrayobject *self, PyObject *unused)
14931493
{
14941494
Py_UNICODE typecode;
14951495
typecode = self->ob_descr->typecode;
1496-
if ((typecode != 'u')) {
1496+
if (typecode != 'u') {
14971497
PyErr_SetString(PyExc_ValueError,
14981498
"tounicode() may only be called on unicode type arrays");
14991499
return NULL;
@@ -2107,10 +2107,11 @@ array_repr(arrayobject *a)
21072107
if (len == 0) {
21082108
return PyUnicode_FromFormat("array('%c')", (int)typecode);
21092109
}
2110-
if ((typecode == 'u'))
2110+
if (typecode == 'u') {
21112111
v = array_tounicode(a, NULL);
2112-
else
2112+
} else {
21132113
v = array_tolist(a, NULL);
2114+
}
21142115

21152116
s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
21162117
Py_DECREF(v);

0 commit comments

Comments
 (0)