jshn: improve performance by using let instead of $(( ))
authorFelix Fietkau <nbd@openwrt.org>
Sun, 23 Nov 2014 18:25:39 +0000 (19:25 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 23 Nov 2014 18:25:39 +0000 (19:25 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
sh/jshn.sh

index 5db1667d1f69ecec400c9d4a4de1970a5b36f990..f5cf1d2ad9b32e22ac60f40a230c5556533fe2b2 100644 (file)
@@ -42,7 +42,7 @@ _json_inc() {
        # var=$1
        # dest=$2
 
-       eval "${JSON_PREFIX}$1=\$(( \${${JSON_PREFIX}$1:-0} + 1))${2:+; $2=\"\$${JSON_PREFIX}$1\"}"
+       let "${JSON_PREFIX}$1 += 1" "$2 = ${JSON_PREFIX}$1"
 }
 
 _json_add_generic() {