# HG changeset patch # User Franz Glasner # Date 1739879011 -3600 # Node ID b9aa65a30b4c685b40291da04cc70397592483c6 # Parent 0add8276e6b8482f9e3e6740d984f113438c5449 treesum: optimize the use of flush() somewhat diff -r 0add8276e6b8 -r b9aa65a30b4c cutils/treesum.py --- a/cutils/treesum.py Tue Feb 18 12:39:04 2025 +0100 +++ b/cutils/treesum.py Tue Feb 18 12:43:31 2025 +0100 @@ -690,7 +690,6 @@ util.interpolate_bytes(b"%s/./@/", opath), linkdgst.digest(), self._use_base64) - self._writer.flush() else: # # Follow the symlink to dir or handle a "real" directory @@ -811,7 +810,6 @@ util.interpolate_bytes(b"%s/./@", opath), linkdgst.digest(), self._use_base64) - self._writer.flush() else: # # Follow the symlink to file or handle a "real" file @@ -902,7 +900,7 @@ self._algorithm[1], opath, dgst, use_base64=self._use_base64, size=sz) - self._writer.flush() + self._writer.flush() opath = join_output_path(top, None) if opath: if self._utf8_mode: @@ -1119,6 +1117,7 @@ crc = self._crc.hexdigest() self.write(b"CRC32 = ") self.writeln(util.b(crc)) + self.flush() def writeln(self, line): """Write the bytes `line` into the output file and update the CRC