Patchwork [01,of,10,py3] obsolete: reuse _fm1metapair for computing _fm1metapairsize

login
register
mail settings
Submitter Augie Fackler
Date Aug. 1, 2017, 8:34 p.m.
Message ID <87ee5c3b3271ded54fe4.1501619669@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/22609/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 1, 2017, 8:34 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1500906083 14400
#      Mon Jul 24 10:21:23 2017 -0400
# Node ID 87ee5c3b3271ded54fe4462aa43a9d1520b8a10b
# Parent  658524d45af0dbb627b25d795ed84227a20fd634
obsolete: reuse _fm1metapair for computing _fm1metapairsize

It's evaluated at import time, so it seems silly to not reuse the
constant name.

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -314,7 +314,7 @@  def _fm0decodemeta(data):
 _fm1parentshift = 14
 _fm1parentmask = (_fm1parentnone << _fm1parentshift)
 _fm1metapair = 'BB'
-_fm1metapairsize = _calcsize('BB')
+_fm1metapairsize = _calcsize(_fm1metapair)
 
 def _fm1purereadmarkers(data, off, stop):
     # make some global constants local for performance