Skip to content

Commit

Permalink
json.nim: smaller init size (#15048)
Browse files Browse the repository at this point in the history
There was a recent `rightSize` change in tables.nim, so the existing
value (4) was creating too large tables.
  • Loading branch information
narimiran authored Jul 23, 2020
1 parent 925dd92 commit 14d16c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pure/json.nim
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ proc newJNull*(): JsonNode =

proc newJObject*(): 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 =
## Creates a new `JArray JsonNode`
Expand Down Expand Up @@ -264,7 +264,7 @@ proc getBool*(n: JsonNode, default: bool = false): bool =
else: return n.bval

proc getFields*(n: JsonNode,
default = initOrderedTable[string, JsonNode](4)):
default = initOrderedTable[string, JsonNode](2)):
OrderedTable[string, JsonNode] =
## Retrieves the key, value pairs of a `JObject JsonNode`.
##
Expand Down

0 comments on commit 14d16c2

Please sign in to comment.