nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b594ef0
)
json: don't reserve an id when not using it
author
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 25 Jul 2017 15:26:50 +0000
(11:26 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 10 Aug 2017 16:10:08 +0000
(12:10 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/json/serialization_write.nit
patch
|
blob
|
history
diff --git
a/lib/json/serialization_write.nit
b/lib/json/serialization_write.nit
index
eeb30ff
..
d591b2e
100644
(file)
--- a/
lib/json/serialization_write.nit
+++ b/
lib/json/serialization_write.nit
@@
-242,10
+242,10
@@
redef class Serializable
# which is used by all the serialization engines, not just JSON.
protected fun accept_json_serializer(v: JsonSerializer)
do
- var id = v.cache.new_id_for(self)
v.stream.write "\{"
v.indent_level += 1
if not v.plain_json then
+ var id = v.cache.new_id_for(self)
v.new_line_and_indent
v.stream.write "\"__kind\": \"obj\", \"__id\": "
v.stream.write id.to_s