Speed up psymbol reading by removing a copy
[deliverable/binutils-gdb.git] / gdb / c-typeprint.c
index 50d0eaa2ddedb8c863f51cf0a703aef35e996576..aaf9e0dfe0a1a70a5dbae4edfb96c80f168688fa 100644 (file)
@@ -84,14 +84,14 @@ print_name_maybe_canonical (const char *name,
                            const struct type_print_options *flags,
                            struct ui_file *stream)
 {
-  std::string s;
+  gdb::unique_xmalloc_ptr<char> s;
 
   if (!flags->raw)
     s = cp_canonicalize_string_full (name,
                                     find_typedef_for_canonicalize,
                                     (void *) flags);
 
-  fputs_filtered (!s.empty () ? s.c_str () : name, stream);
+  fputs_filtered (s != nullptr ? s.get () : name, stream);
 }
 
 \f
This page took 0.025747 seconds and 4 git commands to generate.