Mercurial > public > mercurial-scm > hg
comparison mercurial/statprof.py @ 38697:3c569172848d
statprof: small if cleanup
Explicitly testing for None to avoid comparison bugs.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 01 Jun 2018 12:10:34 +0200 |
parents | 99188a7c8717 |
children | 8943c1352b6c |
comparison
equal
deleted
inserted
replaced
38696:89d93dd1a222 | 38697:3c569172848d |
---|---|
452 Json = 5 | 452 Json = 5 |
453 Chrome = 6 | 453 Chrome = 6 |
454 | 454 |
455 def display(fp=None, format=3, data=None, **kwargs): | 455 def display(fp=None, format=3, data=None, **kwargs): |
456 '''Print statistics, either to stdout or the given file object.''' | 456 '''Print statistics, either to stdout or the given file object.''' |
457 data = data or state | 457 if data is None: |
458 data = state | |
458 | 459 |
459 if fp is None: | 460 if fp is None: |
460 import sys | 461 import sys |
461 fp = sys.stdout | 462 fp = sys.stdout |
462 if len(data.samples) == 0: | 463 if len(data.samples) == 0: |