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

Unified Diff: runtime/vm/debugger.cc

Issue 1331623002: Uses SNPRINT macro where possible. Otherwise uses #define for format. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add back assembler functions Created 5 years, 3 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
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 6c0a2d069274e26e82b17c12807065496abd41e4..5e22351efe5bc7e57279406af77b5aa697e12906 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -418,18 +418,10 @@ const char* Debugger::QualifiedFunctionName(const Function& func) {
Class& func_class = Class::Handle(func.Owner());
String& class_name = String::Handle(func_class.Name());
- const char* kFormat = "%s%s%s";
- intptr_t len = OS::SNPrint(NULL, 0, kFormat,
- func_class.IsTopLevel() ? "" : class_name.ToCString(),
- func_class.IsTopLevel() ? "" : ".",
- func_name.ToCString());
- len++; // String terminator.
- char* chars = Thread::Current()->zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, kFormat,
- func_class.IsTopLevel() ? "" : class_name.ToCString(),
+ return OS::SNCreate(Thread::Current()->zone(),
+ "%s%s%s", func_class.IsTopLevel() ? "" : class_name.ToCString(),
func_class.IsTopLevel() ? "" : ".",
func_name.ToCString());
- return chars;
}

Powered by Google App Engine
This is Rietveld 408576698