Skip to content

Commit 4593032

Browse files
committed
some minor improvement
1 parent b3e2a0c commit 4593032

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

python/flatted.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,16 @@ def __init__(self, value):
2626
self.value = value
2727

2828
def _resolver(input, lazy, parsed):
29-
ignore = {}
30-
3129
def resolver(output):
3230
keys = _array_keys(output) if _is_array(output) else _object_keys(output) if _is_object(output) else []
3331
for key in keys:
3432
value = output[key]
3533
if isinstance(value, _String):
3634
tmp = input[int(value.value)]
35+
output[key] = tmp
3736
if (_is_array(tmp) or _is_object(tmp)) and tmp not in parsed:
3837
parsed.append(tmp)
39-
output[key] = ignore
40-
lazy.append([output, key, tmp])
41-
else:
42-
output[key] = tmp
38+
lazy.append([output, key])
4339

4440
return output
4541

@@ -136,9 +132,9 @@ def parse(value, *args, **kwargs):
136132

137133
i = 0
138134
while i < len(lazy):
139-
o, k, r = lazy[i]
135+
o, k = lazy[i]
140136
i += 1
141-
o[k] = revive(r)
137+
o[k] = revive(o[k])
142138

143139
return value
144140

0 commit comments

Comments
 (0)