fix trailing comma in outptu of SkDiffContext
R=djsollen@google.com
Review URL: https://codereview.chromium.org/20324004
git-svn-id: http://skia.googlecode.com/svn/trunk@10361 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp
index 7a28fe1..cf2654a 100644
--- a/tools/skpdiff/SkDiffContext.cpp
+++ b/tools/skpdiff/SkDiffContext.cpp
@@ -157,9 +157,7 @@
DiffRecord* currentRecord = fRecords;
if (useJSONP) {
stream.writeText("var SkPDiffRecords = {\n");
- }
- else
- {
+ } else {
stream.writeText("{\n");
}
stream.writeText(" \"records\": [\n");
@@ -198,8 +196,8 @@
stream.writeText("]");
// JSON does not allow trailing commas
- if (poiIndex + 1 < data.fPointsOfInterest.count())
- {
+ if (poiIndex + 1 < data.fPointsOfInterest.count() &&
+ poiIndex + 1 < kMaxPOI) {
stream.writeText(",");
}
stream.writeText("\n");
@@ -208,8 +206,7 @@
stream.writeText(" }");
// JSON does not allow trailing commas
- if (diffIndex + 1 < currentRecord->fDiffs.count())
- {
+ if (diffIndex + 1 < currentRecord->fDiffs.count()) {
stream.writeText(",");
}
stream.writeText(" \n");
@@ -219,8 +216,7 @@
stream.writeText(" }");
// JSON does not allow trailing commas
- if (NULL != currentRecord->fNext)
- {
+ if (NULL != currentRecord->fNext) {
stream.writeText(",");
}
stream.writeText("\n");
@@ -229,9 +225,7 @@
stream.writeText(" ]\n");
if (useJSONP) {
stream.writeText("};\n");
- }
- else
- {
+ } else {
stream.writeText("}\n");
}
}