changeset 39092:8943c1352b6c

statprof: cleanup string construction Use string substitutions instead of string additions.
author Boris Feld <boris.feld@octobus.net>
date Fri, 01 Jun 2018 11:36:06 +0200
parents ddc1da134772
children cc37009e95ca
files mercurial/statprof.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/statprof.py	Wed Jul 25 17:11:59 2018 +0200
+++ b/mercurial/statprof.py	Fri Jun 01 11:36:06 2018 +0200
@@ -356,7 +356,7 @@
             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()