#5421 closed defect (fixed)
get rid of space in the output of toJson if prettyPrint=false
Reported by: | liucougar | Owned by: | liucougar |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | General | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
the spaces in the output of toJson is not necessary
the patch change it so that it only adds in spaces if prettyPrint=true
Attachments (1)
Change History (8)
Changed 13 years ago by
Attachment: | 5421.patch added |
---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
also, I have to wonder if the indent string were meant to appear before and in between each element in hashes and arrays instead of just after the join?
comment:4 Changed 13 years ago by
comment:5 Changed 13 years ago by
Just a quick note that this was originally changed to have the space to solve another ticket because the space is part of the JSON specification. In practice I don't think it matters. However, shoudl our default be to generate standard compliant (prettyPrint=true) or working/smaller output?
comment:6 Changed 13 years ago by
json.org only seems to state that whitespace "can" be inserted between tokens, so I think we're okay making this optional, unless I'm missing something. Seems like there's value encouraging saving space by default, and a third option just introduces more API complexity.
comment:7 Changed 13 years ago by
I'm fine with that, its only a comment...especially if spaces are in fact allowed according to spec. I bring it up only because it used to not have the space in there and then it was changed to have it :P
+1 on the concept. It might be a bit more concise to express this as a single sep variable of " " or "" and just append it in both cases. Since this is base, every byte counts.