Skip to content

Commit

Permalink
Merge pull request mighty-gerbils#409 from vyzo/optimize-json
Browse files Browse the repository at this point in the history
json: go fast please!
  • Loading branch information
vyzo authored Nov 13, 2019
2 parents c21e6e8 + 3869212 commit bcca79f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/std/text/json.ss
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
;;; Scheme lists
(import :gerbil/gambit/ports
:gerbil/gambit/bits
:gerbil/gambit/exact
:std/error
(only-in :std/srfi/1 reverse!))
(export read-json write-json
string->json-object json-object->string
json-symbolic-keys)
(declare (not safe))

(def (read-json (port (current-input-port)))
(read-json-object port #f))
Expand Down Expand Up @@ -256,7 +258,7 @@
(cond
((number? obj)
(cond
((and (exact? obj) (integer? obj))
((exact-integer? obj)
(write-string (number->string obj) port))
((inexact? obj)
(write-json-inexact obj port))
Expand Down

0 comments on commit bcca79f

Please sign in to comment.