Mercurial > public > mercurial-scm > hg-stable
diff mercurial/statprof.py @ 49026:2cce2fa5bcf7
py3: replace pycompat.itervalues(x) with x.values()
pycompat.itervalues(x) just calls x.values(). So this is equivalent.
The rewrite was perfomed via an automated search and replace.
Differential Revision: https://phab.mercurial-scm.org/D12341
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 01 Mar 2022 20:52:32 -0800 |
parents | f254fc73d956 |
children | 37537a4d2695 |
line wrap: on
line diff
--- a/mercurial/statprof.py Mon Feb 21 11:24:57 2022 -0700 +++ b/mercurial/statprof.py Tue Mar 01 20:52:32 2022 -0800 @@ -474,7 +474,7 @@ if i == 0: sitestat.addself() - return [s for s in pycompat.itervalues(stats)] + return [s for s in stats.values()] class DisplayFormats: @@ -745,9 +745,7 @@ def _write(node, depth, multiple_siblings): site = node.site visiblechildren = [ - c - for c in pycompat.itervalues(node.children) - if c.count >= (limit * root.count) + c for c in node.children.values() if c.count >= (limit * root.count) ] if site: indent = depth * 2 - 1 @@ -783,9 +781,7 @@ ) finalstring = liststring + codestring - childrensamples = sum( - [c.count for c in pycompat.itervalues(node.children)] - ) + childrensamples = sum([c.count for c in node.children.values()]) # Make frames that performed more than 10% of the operation red if node.count - childrensamples > (0.1 * root.count): finalstring = b'\033[91m' + finalstring + b'\033[0m'