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

Unified Diff: Source/devtools/front_end/platform/utilities.js

Issue 1310303004: [DevTools] Reduce amount of tokens produced by tokenizeFormatString (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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: Source/devtools/front_end/platform/utilities.js
diff --git a/Source/devtools/front_end/platform/utilities.js b/Source/devtools/front_end/platform/utilities.js
index 2e2939251e5a93d7558685853e35fa26b6b44af0..7e972bf8de041cd79b1ddb4dc9ee099be5d599ba 100644
--- a/Source/devtools/front_end/platform/utilities.js
+++ b/Source/devtools/front_end/platform/utilities.js
@@ -959,7 +959,10 @@ String.tokenizeFormatString = function(format, formatters)
function addStringToken(str)
{
- tokens.push({ type: "string", value: str });
+ if (tokens.length && tokens[tokens.length - 1].type === "string")
+ tokens[tokens.length - 1].value += str;
+ else
+ tokens.push({ type: "string", value: str });
}
function addSpecifierToken(specifier, precision, substitutionIndex)
« 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