json.nim: smaller init size (#15048)
There was a recent `rightSize` change in tables.nim, so the existing value (4) was creating too large tables.
This commit is contained in:
parent
925dd92e07
commit
14d16c2174
1 changed files with 2 additions and 2 deletions
|
|
@ -219,7 +219,7 @@ proc newJNull*(): JsonNode =
|
||||||
|
|
||||||
proc newJObject*(): JsonNode =
|
proc newJObject*(): JsonNode =
|
||||||
## Creates a new `JObject JsonNode`
|
## Creates a new `JObject JsonNode`
|
||||||
result = JsonNode(kind: JObject, fields: initOrderedTable[string, JsonNode](4))
|
result = JsonNode(kind: JObject, fields: initOrderedTable[string, JsonNode](2))
|
||||||
|
|
||||||
proc newJArray*(): JsonNode =
|
proc newJArray*(): JsonNode =
|
||||||
## Creates a new `JArray JsonNode`
|
## Creates a new `JArray JsonNode`
|
||||||
|
|
@ -264,7 +264,7 @@ proc getBool*(n: JsonNode, default: bool = false): bool =
|
||||||
else: return n.bval
|
else: return n.bval
|
||||||
|
|
||||||
proc getFields*(n: JsonNode,
|
proc getFields*(n: JsonNode,
|
||||||
default = initOrderedTable[string, JsonNode](4)):
|
default = initOrderedTable[string, JsonNode](2)):
|
||||||
OrderedTable[string, JsonNode] =
|
OrderedTable[string, JsonNode] =
|
||||||
## Retrieves the key, value pairs of a `JObject JsonNode`.
|
## Retrieves the key, value pairs of a `JObject JsonNode`.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue