# HG changeset patch # User Raphaël Gomès # Date 1718810360 -7200 # Node ID 384016e91947021f21eaec66d997dfd37d2c72dc # Parent eb9dea148233e330ae218bac77a092224c64692a revlog: simplify rawtext return value We're always returning a tuple even though only the raw text is being used, and we're rebuilding another tuple again higher. As a bonus, this will remove one tuple creation and deletion per `raw_text` call, hence fewer gc calls, etc. diff -r eb9dea148233 -r 384016e91947 mercurial/revlog.py --- a/mercurial/revlog.py Wed Jun 19 17:06:05 2024 +0200 +++ b/mercurial/revlog.py Wed Jun 19 17:19:20 2024 +0200 @@ -1022,7 +1022,7 @@ def raw_text(self, node, rev): """return the possibly unvalidated rawtext for a revision - returns (rev, rawtext, validated) + returns rawtext """ # revision in the cache (could be useful to apply delta) @@ -1063,7 +1063,7 @@ rawtext = mdiff.patches(basetext, bins) del basetext # let us have a chance to free memory early - return (rev, rawtext, False) + return rawtext def sidedata(self, rev, sidedata_end): """Return the sidedata for a given revision number.""" @@ -2761,7 +2761,8 @@ if rev is None: rev = self.rev(node) - return self._inner.raw_text(node, rev) + text = self._inner.raw_text(node, rev) + return (rev, text, False) def _revisiondata(self, nodeorrev, raw=False): # deal with argument type