Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't indent when debug=false

  • Loading branch information...
commit 513e1ff19fdd91cdfc7c6053a027f6eec9eb585c 1 parent 933600e
@rnewson authored
View
9 src/main/java/com/github/rnewson/couchdb/lucene/DatabaseIndexer.java
@@ -620,11 +620,14 @@ public void search(final HttpServletRequest req,
if (callback != null) {
body = String.format("%s(%s)", callback, json);
} else {
- final int indentFactor = getBooleanParameter(req, "debug") ? 2 : 0;
if (json instanceof JSONObject) {
- body = ((JSONObject)json).toString(indentFactor);
+ final JSONObject obj = (JSONObject) json;
+ body = getBooleanParameter(req, "debug") ?
+ obj.toString(2) : obj.toString();
} else {
- body = ((JSONArray)json).toString(indentFactor);
+ final JSONArray arr = (JSONArray) json;
+ body = getBooleanParameter(req, "debug") ?
+ arr.toString(2) : arr.toString();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.