diff options
author | 2013-07-25 17:22:58 +0000 | |
---|---|---|
committer | 2013-07-25 17:22:58 +0000 | |
commit | 55173f2ecc8103b7675655f4a35990ac98050205 (patch) | |
tree | adc24749d6c312412076c1b747659c4b783aad9b /tools | |
parent | 50bbdb4f3edc5005a71c438651732f53c00a5331 (diff) |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/skpdiff/SkDiffContext.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp index 7a28fe13c9..cf2654ac05 100644 --- a/tools/skpdiff/SkDiffContext.cpp +++ b/tools/skpdiff/SkDiffContext.cpp @@ -157,9 +157,7 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) { DiffRecord* currentRecord = fRecords; if (useJSONP) { stream.writeText("var SkPDiffRecords = {\n"); - } - else - { + } else { stream.writeText("{\n"); } stream.writeText(" \"records\": [\n"); @@ -198,8 +196,8 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) { 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 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) { 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 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) { 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 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) { stream.writeText(" ]\n"); if (useJSONP) { stream.writeText("};\n"); - } - else - { + } else { stream.writeText("}\n"); } } |