From 2daebc090f271fe2e3fda3247748c7269e0d4190 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 21 Feb 2024 13:50:51 +0100 Subject: [PATCH] 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 --- src/utils/acmp.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/acmp.cc b/src/utils/acmp.cc index 2bfe7acb..708ce3a2 100644 --- a/src/utils/acmp.cc +++ b/src/utils/acmp.cc @@ -190,10 +190,9 @@ static size_t acmp_strlen(ACMP *parser, const char *str) { * len - length of input string */ static void acmp_strtoucs(ACMP *parser, const char *str, long *ucs_chars, int len) { - int i; const char *c = str; - for (i = 0; i < len; i++) { + for (int i = 0;i < len;i++) { *(ucs_chars++) = *(c++); } }