Skip to content

Commit

Permalink
adjust number handling (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
jam01 authored Dec 8, 2024
1 parent 3c2ee46 commit 3de4d65
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ object VisitorNumberReader {
} else {
val x = in.readBigInt(null)
if (x.isValidLong) v.visitInt64(x.longValue, -1)
else v.visitString(x.toString(), -1) // see: ujson/JsVisitor.scala#L33
// alt: v.visitFloat64StringParts(x.toString(), -1, -1, -1)
else v.visitFloat64StringParts(x.toString(), -1, -1, -1)
}
} else {
in.setMark()
Expand All @@ -104,8 +103,8 @@ object VisitorNumberReader {
x
} else {
in.rollbackToMark()
v.visitString(new String(in.readRawValAsBytes(), StandardCharsets.US_ASCII), -1) // see: ujson/JsVisitor.scala#L33
// alt: v.visitFloat64StringParts(new String(in.readRaw...), -1, -1, -1)
val bytes = in.readRawValAsBytes()
v.visitFloat64ByteParts(bytes, 0, bytes.length, -1, -1, -1)
}
}
}
Expand Down

0 comments on commit 3de4d65

Please sign in to comment.