projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jshn: improve performance by using let instead of $(( ))
[project/libubox.git]
/
sh
/
jshn.sh
diff --git
a/sh/jshn.sh
b/sh/jshn.sh
index
b3cd43c
..
f5cf1d2
100644
(file)
--- a/
sh/jshn.sh
+++ b/
sh/jshn.sh
@@
-42,7
+42,7
@@
_json_inc() {
# var=$1
# dest=$2
# 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() {
}
_json_add_generic() {
@@
-103,7
+103,7
@@
json_set_namespace() {
}
json_cleanup() {
}
json_cleanup() {
- local unset
+ local unset
tmp
_json_get_var unset JSON_UNSET
for tmp in $unset JSON_VAR; do
_json_get_var unset JSON_UNSET
for tmp in $unset JSON_VAR; do
@@
-174,7
+174,7
@@
json_add_double() {
# functions read access to json variables
json_load() {
# functions read access to json variables
json_load() {
- eval
`jshn -r "$1"`
+ eval
"`jshn -r "$1"`"
}
json_dump() {
}
json_dump() {