From 546499713651809f026e118f81b9c52f01c895f6 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 26 Aug 2009 17:35:54 -0700 Subject: Remove unnecessary static members When a static class member is only used by a single method, it's more concise to use a static local variable instead. * staptree.cxx (probe::probe): Make last_probeidx a static local. * tapset-perfmon.cxx (perfmon_derived_probe::perfmon_derived_probe): Make probes_allocated a static local. --- staptree.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'staptree.cxx') diff --git a/staptree.cxx b/staptree.cxx index aa37b754..b4975017 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -97,10 +97,10 @@ probe_point::probe_point (): } -unsigned probe::last_probeidx = 0; probe::probe (): body (0), tok (0) { + static unsigned last_probeidx = 0; this->name = string ("probe_") + lex_cast(last_probeidx ++); } -- cgit