Skip to content

Commit 2daebc0

Browse files
committed
src/utils/acmp.cc: reduce the scope of variable in a for () loop
In general, it is always preferable to reduce the scope of a variable in a for loop
1 parent 7fed599 commit 2daebc0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/utils/acmp.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ static size_t acmp_strlen(ACMP *parser, const char *str) {
190190
* len - length of input string
191191
*/
192192
static void acmp_strtoucs(ACMP *parser, const char *str, long *ucs_chars, int len) {
193-
int i;
194193
const char *c = str;
195194

196-
for (i = 0; i < len; i++) {
195+
for (int i = 0;i < len;i++) {
197196
*(ucs_chars++) = *(c++);
198197
}
199198
}

0 commit comments

Comments
 (0)