# HG changeset patch # User Boris Feld <boris.f...@octobus.net> # Date 1527845766 -7200 # Fri Jun 01 11:36:06 2018 +0200 # Node ID c4f06c80b89fe473ca5e3b704652c96068424c5f # Parent faea9b1980d9b0c97f3e457b5f271248fcd63716 # EXP-Topic cleanupstat # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c4f06c80b89f statprof: cleanup string construction
Use string substitutions instead of string additions. diff --git a/mercurial/statprof.py b/mercurial/statprof.py --- a/mercurial/statprof.py +++ b/mercurial/statprof.py @@ -356,7 +356,7 @@ def save_data(path): stack = sample.stack sites = ['\1'.join([s.path, str(s.lineno), s.function]) for s in stack] - file.write(time + '\0' + '\0'.join(sites) + '\n') + file.write("%s\0%s\n" % (time, '\0'.join(sites))) def load_data(path): lines = open(path, 'r').read().splitlines() _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel