##// END OF EJS Templates
ui: inline _write() into write() due to performance issue...
Yuya Nishihara -
r41376:b4a3abdc stable
parent child Browse files
Show More
@@ -999,12 +999,23 b' class ui(object):'
999 "cmdname.type" is recommended. For example, status issues
999 "cmdname.type" is recommended. For example, status issues
1000 a label of "status.modified" for modified files.
1000 a label of "status.modified" for modified files.
1001 '''
1001 '''
1002 self._write(self._fout, *args, **opts)
1002 dest = self._fout
1003
1004 # inlined _write() for speed
1005 if self._isbuffered(dest):
1006 label = opts.get(r'label', '')
1007 if label and self._bufferapplylabels:
1008 self._buffers[-1].extend(self.label(a, label) for a in args)
1009 else:
1010 self._buffers[-1].extend(args)
1011 else:
1012 self._writenobuf(dest, *args, **opts)
1003
1013
1004 def write_err(self, *args, **opts):
1014 def write_err(self, *args, **opts):
1005 self._write(self._ferr, *args, **opts)
1015 self._write(self._ferr, *args, **opts)
1006
1016
1007 def _write(self, dest, *args, **opts):
1017 def _write(self, dest, *args, **opts):
1018 # update write() as well if you touch this code
1008 if self._isbuffered(dest):
1019 if self._isbuffered(dest):
1009 label = opts.get(r'label', '')
1020 label = opts.get(r'label', '')
1010 if label and self._bufferapplylabels:
1021 if label and self._bufferapplylabels:
General Comments 0
You need to be logged in to leave comments. Login now