Skip to content

Commit

Permalink
make a roundtrip to have stable numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Apr 18, 2024
1 parent 6834009 commit 5455440
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/jsonpak/parser.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import std/[parsejson, streams], private/[jsontree, jsonnode]
import std/[parsejson, streams, strutils], private/[jsontree, jsonnode]
export JsonParsingError

proc parseJsonAtom(tree: var JsonTree; p: var JsonParser) =
Expand All @@ -10,7 +10,7 @@ proc parseJsonAtom(tree: var JsonTree; p: var JsonParser) =
storeAtom(tree, opcodeInt, p.a)
discard getTok(p)
of tkFloat:
storeAtom(tree, opcodeFloat, p.a)
storeAtom(tree, opcodeFloat, $parseFloat(p.a)) # roundtrip
discard getTok(p)
of tkTrue:
storeAtom(tree, opcodeTrue)
Expand Down
2 changes: 0 additions & 2 deletions src/jsonpak/private/rawops_sorted.nim
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ proc rawDeduplicate*(tree: var JsonTree, n: NodePos, parents: var seq[PatchPos])

proc rawHash*(tree: JsonTree, n: NodePos): Hash =
privateAccess(JsonTree)
# iff we knew that BiTable.vals doesn't contain
# stale entries we could significantly speed this up.
var h = Hash(0)
let L = span(tree, n.int)
for i in 0..<L:
Expand Down

0 comments on commit 5455440

Please sign in to comment.