Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97e561e

Browse files
author
Victor Stinner
committed
Avoid useless "++" at the end of functions
Warnings found by the Clang Static Analyzer.
1 parent 25095b2 commit 97e561e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Objects/setobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ set_repr(PySetObject *so)
612612
*u++ = '{';
613613
/* Omit the brackets from the listrepr */
614614
Py_UNICODE_COPY(u, PyUnicode_AS_UNICODE(listrepr)+1,
615-
PyUnicode_GET_SIZE(listrepr)-2);
615+
newsize-2);
616616
u += newsize-2;
617-
*u++ = '}';
617+
*u = '}';
618618
}
619619
Py_DECREF(listrepr);
620620
if (Py_TYPE(so) != &PySet_Type) {

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6474,7 +6474,7 @@ PyUnicode_EncodeDecimal(Py_UNICODE *s,
64746474
}
64756475
}
64766476
/* 0-terminate the output string */
6477-
*output++ = '\0';
6477+
*output = '\0';
64786478
Py_XDECREF(exc);
64796479
Py_XDECREF(errorHandler);
64806480
return 0;

Python/compile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,11 +3747,11 @@ assemble_lnotab(struct assembler *a, struct instr *i)
37473747
a->a_lnotab_off += 2;
37483748
if (d_bytecode) {
37493749
*lnotab++ = d_bytecode;
3750-
*lnotab++ = d_lineno;
3750+
*lnotab = d_lineno;
37513751
}
37523752
else { /* First line of a block; def stmt, etc. */
37533753
*lnotab++ = 0;
3754-
*lnotab++ = d_lineno;
3754+
*lnotab = d_lineno;
37553755
}
37563756
a->a_lineno = i->i_lineno;
37573757
a->a_lineno_off = a->a_offset;
@@ -3796,7 +3796,7 @@ assemble_emit(struct assembler *a, struct instr *i)
37963796
if (i->i_hasarg) {
37973797
assert(size == 3 || size == 6);
37983798
*code++ = arg & 0xff;
3799-
*code++ = arg >> 8;
3799+
*code = arg >> 8;
38003800
}
38013801
return 1;
38023802
}

0 commit comments

Comments
 (0)