From 2ec92b34f21b4c1035a3161a039a42e17aed4641 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 13 Nov 2015 18:12:51 -0800 Subject: [PATCH] Take a plain string for print_format::string_to_components This is mostly called with print_format::raw_components, which is a string, and an interned value isn't needed for sharing within, so avoid it. It might be nicer to make raw_components an interned_string itself, but a few places in tapsets.cxx are building that string incrementally, so they'd need a bit of refactoring to use separate string buffers first. --- staptree.cxx | 4 ++-- staptree.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/staptree.cxx b/staptree.cxx index a0d843f97..6e5fdd644 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -821,14 +821,14 @@ print_format::components_to_string(vector const & components) } vector -print_format::string_to_components(interned_string str) +print_format::string_to_components(string const & str) { format_component curr; vector res; curr.clear(); - interned_string::const_iterator i = str.begin(); + string::const_iterator i = str.begin(); string literal_str; while (i != str.end()) diff --git a/staptree.h b/staptree.h index e55a206e2..032f7dc30 100644 --- a/staptree.h +++ b/staptree.h @@ -525,7 +525,7 @@ struct print_format: public expression hist_op *hist; static std::string components_to_string(std::vector const & components); - static std::vector string_to_components(interned_string str); + static std::vector string_to_components(std::string const & str); static print_format* create(const token *t, const char *n = NULL); void print (std::ostream& o) const; -- 2.43.5