1. Mikhail Korobov
  2. DAWG-Python


Mikhail Korobov  committed 856f1d8

remove a couple of unneeded operations

  • Participants
  • Parent commits 8900822
  • Branches default

Comments (0)

Files changed (1)

File dawg_python/units.py

View file
 def has_leaf(base):
     " Checks if a unit has a leaf as a child or not."
-    return bool(base & HAS_LEAF_BIT & PRECISION_MASK)
+    return bool(base & HAS_LEAF_BIT)
 def value(base):
     "Checks if a unit corresponds to a leaf or not."
 def label(base):
     "Reads a label with a leaf flag from a non-leaf unit."
-    return base & (IS_LEAF_BIT | 0xFF) & PRECISION_MASK
+    return base & (IS_LEAF_BIT | 0xFF)
 def offset(base):
     "Reads an offset to child units from a non-leaf unit."