[PATCH 2 of 2] statprof: small if cleanup
Boris Feld
boris.feld at octobus.net
Mon Jul 16 04:59:58 EDT 2018
# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1527847834 -7200
# Fri Jun 01 12:10:34 2018 +0200
# Node ID e97a69d13f38cbb4389fdc8a7555eab0753c5af9
# Parent eabea66333aa934d8a8f0fc68633a72623a0864b
# EXP-Topic cleanupstat
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r e97a69d13f38
statprof: small if cleanup
Explicitly testing for None to avoid comparison bugs.
diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -454,7 +454,8 @@ class DisplayFormats:
def display(fp=None, format=3, data=None, **kwargs):
'''Print statistics, either to stdout or the given file object.'''
- data = data or state
+ if data is None:
+ data = state
if fp is None:
import sys
More information about the Mercurial-devel
mailing list