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

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 missing include 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
« no previous file with comments | « runtime/vm/coverage.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 6c0a2d069274e26e82b17c12807065496abd41e4..c4a6a15f48a3517c6e12b51f53003b3668daaa3f 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::SCreate(Thread::Current()->zone(),
+ "%s%s%s", func_class.IsTopLevel() ? "" : class_name.ToCString(),
func_class.IsTopLevel() ? "" : ".",
func_name.ToCString());
- return chars;
}
« no previous file with comments | « runtime/vm/coverage.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698