This makes code cleaner and helps compiler to optimize

Signed-off-by: Sergey Ponomarev <[email protected]>
---
 jshn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/jshn.c b/jshn.c
index 8fdd290..7a2f935 100644
--- a/jshn.c
+++ b/jshn.c
@@ -96,8 +96,10 @@ static void add_json_string(const char *str)
 
 static void write_key_string(const char *key)
 {
-       while (*key) {
-               putc(isalnum(*key) ? *key : '_', stdout);
+       char k;
+       while ((k = *key)) {
+               k = isalnum(k) ? k : '_';
+               putc(k, stdout);
                key++;
        }
 }
-- 
2.27.0


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to