Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: tools/skpdiff/SkDiffContext.cpp

Issue 20324004: fix trailing comma in outptu of SkDiffContext (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpdiff/SkDiffContext.cpp
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp
index 7a28fe13c95a3f6f47c5c8a10c961f2678f32e22..cf2654ac054ca395933e84d677f7f146b9cd5deb 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");
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698