From aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 2 Sep 2009 16:14:08 -0700 Subject: Unify lex_cast* and avoid string copies We always use lex_cast either to string or from string, so I made that explicit, and got rid of some string copies in the process. There was also stringify(), which was redundant to lex_cast. We also always used lex_cast_hex to string, so that's now hard-coded and again eliminated a string copy. For lex_cast_qstring, there's no need to write the streamify the input, so a specialization now operates directly on the input. Hopefully this is a bit cleaner, and I do measure it to be a little faster on scripts with many probes. --- main.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index b97d0092..d8c780c2 100644 --- a/main.cxx +++ b/main.cxx @@ -486,8 +486,8 @@ main (int argc, char * const argv []) s.buffer_size = 0; s.last_pass = 5; - s.module_name = "stap_" + stringify(getpid()); - s.stapconf_name = "stapconf_" + stringify(getpid()) + ".h"; + s.module_name = "stap_" + lex_cast(getpid()); + s.stapconf_name = "stapconf_" + lex_cast(getpid()) + ".h"; s.output_file = ""; // -o FILE s.keep_tmpdir = false; s.cmd = ""; -- cgit