tests/test-revlog-raw.py
changeset 51690 493034cc3265
parent 51043 8ed03f773eac
child 51700 7f0cb9ee0534
equal deleted inserted replaced
51689:39e2b2d062c1 51690:493034cc3265
   244 
   244 
   245     The combination of two adjacent numbers will cover all possible cases.
   245     The combination of two adjacent numbers will cover all possible cases.
   246     That is to say, given any x, y where both x, and y are in range(2 ** n),
   246     That is to say, given any x, y where both x, and y are in range(2 ** n),
   247     there is an x followed immediately by y in the generated sequence.
   247     there is an x followed immediately by y in the generated sequence.
   248     """
   248     """
   249     m = 2 ** n
   249     m = 2**n
   250 
   250 
   251     # Gray Code. See https://en.wikipedia.org/wiki/Gray_code
   251     # Gray Code. See https://en.wikipedia.org/wiki/Gray_code
   252     gray = lambda x: x ^ (x >> 1)
   252     gray = lambda x: x ^ (x >> 1)
   253     reversegray = {gray(i): i for i in range(m)}
   253     reversegray = {gray(i): i for i in range(m)}
   254 
   254