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

Unified Diff: src/gpu/GrAuditTrail.cpp

Issue 1777203003: Fix some bugs and performance issues with skiaserve (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 4 years, 9 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 | tools/debugger/SkDebugCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAuditTrail.cpp
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp
index 21b7a29251ae64d2768a4cc3020aebde0e9b81c8..353d90183cfdeb0ec932cd67ac1b1a1cb654bc06 100644
--- a/src/gpu/GrAuditTrail.cpp
+++ b/src/gpu/GrAuditTrail.cpp
@@ -147,14 +147,13 @@ void GrAuditTrail::JsonifyTArray(SkString* json, const char* name, const T& arra
json->appendf(",");
}
json->appendf("\"%s\": [", name);
+ const char* separator = "";
for (int i = 0; i < array.count(); i++) {
// Handle sentinel nullptrs
- if (!array[i]) {
- continue;
- }
- json->append(array[i]->toJson());
- if (i < array.count() - 1) {
- json->append(",");
+ if (array[i]) {
+ json->appendf("%s", separator);
+ json->append(array[i]->toJson());
+ separator = ",";
}
}
json->append("]");
« no previous file with comments | « no previous file | tools/debugger/SkDebugCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698