From patchwork Sat Aug 31 22:59:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6778: statprof: clarify by naming tuple members while enumerate()'ing From: phabricator X-Patchwork-Id: 41451 Message-Id: <347e7737757637e31670590a19028c08@localhost.localdomain> To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 31 Aug 2019 22:59:10 +0000 Closed by commit rHG3f81d58aae25: statprof: clarify by naming tuple members while enumerate()'ing (authored by martinvonz). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6778?vs=16343&id=16348 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6778/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6778 AFFECTED FILES mercurial/statprof.py CHANGE DETAILS To: martinvonz, #hg-reviewers, pulkit Cc: mercurial-devel diff --git a/mercurial/statprof.py b/mercurial/statprof.py --- a/mercurial/statprof.py +++ b/mercurial/statprof.py @@ -878,7 +878,8 @@ laststack = collections.deque(stack) while laststack: poplast() - events = [s[1] for s in enumerate(samples) if s[0] not in blacklist] + events = [sample for idx, sample in enumerate(samples) + if idx not in blacklist] frames = collections.OrderedDict((str(k), v) for (k,v) in enumerate(id2stack)) json.dump(dict(traceEvents=events, stackFrames=frames), fp, indent=1)