summaryrefslogtreecommitdiff
path: root/Lib/pstats.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-22 06:29:21 +0000
committerGeorg Brandl <georg@python.org>2010-10-22 06:29:21 +0000
commit90c30044466bf6668536760f5a3c3e74643bcd26 (patch)
treed5b32c4e2efedf9fe9173b7ef266ed48c6c0a629 /Lib/pstats.py
parenta266e21924c0f71fd86f8f22a922f96e79b8344d (diff)
downloadcpython-90c30044466bf6668536760f5a3c3e74643bcd26.tar.gz
Make top_level attribute a set instead of a dict with None values.
Diffstat (limited to 'Lib/pstats.py')
-rw-r--r--Lib/pstats.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 8744235ad0..321d2684ac 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -89,7 +89,7 @@ class Stats:
self.total_calls = 0
self.prim_calls = 0
self.max_name_len = 0
- self.top_level = {}
+ self.top_level = set()
self.stats = {}
self.sort_arg_dict = {}
self.load_stats(arg)
@@ -132,7 +132,7 @@ class Stats:
self.prim_calls += cc
self.total_tt += tt
if ("jprofile", 0, "profiler") in callers:
- self.top_level[func] = None
+ self.top_level.add(func)
if len(func_std_string(func)) > self.max_name_len:
self.max_name_len = len(func_std_string(func))
@@ -147,7 +147,7 @@ class Stats:
self.prim_calls += item.prim_calls
self.total_tt += item.total_tt
for func in item.top_level:
- self.top_level[func] = None
+ self.top_level.add(func)
if self.max_name_len < item.max_name_len:
self.max_name_len = item.max_name_len
@@ -260,9 +260,9 @@ class Stats:
else:
newstats[newfunc] = (cc, nc, tt, ct, newcallers)
old_top = self.top_level
- self.top_level = new_top = {}
+ self.top_level = new_top = set()
for func in old_top:
- new_top[func_strip_path(func)] = None
+ new_top.add(func_strip_path(func))
self.max_name_len = max_name_len