summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Word <argoday@argoday.com>2017-05-03 15:49:21 -0400
committerGitHub <noreply@github.com>2017-05-03 15:49:21 -0400
commitca12bd9b5d15c0c4e5bd01d706ddbb3f4edefd36 (patch)
tree684341e61eb457d48d5c4971d6cafcd99c96b4c8
parent6d89e297febdbcbad4ecf201e56fc8ec99f67137 (diff)
Use unsorted keys in walk
Preserve key sorting order when executing in walk, if sorted keys is desired `--sort-keys` should be used to explicitly obtain sorted keys.
-rw-r--r--src/builtin.jq2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/builtin.jq b/src/builtin.jq
index 1a5d1e94..9c543a93 100644
--- a/src/builtin.jq
+++ b/src/builtin.jq
@@ -284,7 +284,7 @@ def bsearch(target):
def walk(f):
. as $in
| if type == "object" then
- reduce keys[] as $key
+ reduce keys_unsorted[] as $key
( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f
elif type == "array" then map( walk(f) ) | f
else f