diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-02 18:55:56 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-02 18:55:56 (GMT) |
commit | e0d4972acc8cfd4b8fb16c074a8031e50fab0f29 (patch) | |
tree | b9a9286453c2ee4397618d4483679c3bc531f4b0 /Lib/profile.py | |
parent | 1fab9ee085755ed2f7abcf28794d7c20bd51a97a (diff) | |
download | cpython-e0d4972acc8cfd4b8fb16c074a8031e50fab0f29.zip cpython-e0d4972acc8cfd4b8fb16c074a8031e50fab0f29.tar.gz cpython-e0d4972acc8cfd4b8fb16c074a8031e50fab0f29.tar.bz2 |
Replaced .keys() with dictionary iterators
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-x | Lib/profile.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/profile.py b/Lib/profile.py index c1001f9..c667db2 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -386,12 +386,11 @@ class Profile: def snapshot_stats(self): self.stats = {} - for func in self.timings.keys(): - cc, ns, tt, ct, callers = self.timings[func] + for func, (cc, ns, tt, ct, callers) in self.timings.iteritems(): callers = callers.copy() nc = 0 - for func_caller in callers.keys(): - nc = nc + callers[func_caller] + for callcnt in callers.itervalues(): + nc += callcnt self.stats[func] = cc, nc, tt, ct, callers |