From 5ae596c892c265c6f84071ee5ba70abf9f756faa Mon Sep 17 00:00:00 2001 From: BurningWitness Date: Mon, 2 Sep 2024 23:12:36 +0300 Subject: [PATCH] Cleanup --- CHANGELOG.md | 2 +- src/Data/Zebra/Word/Debug.hs | 2 +- src/Radix/Word/Debug.hs | 6 +++--- src/Radix/Word8/Debug.hs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4893771..efa5497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ * Fixed `Data.Zebra.Word.fillRange`. Previously it produced malformed trees in certain cases. -## 1.0.0.1 -- April 2024 +## 1.0.0.1 -- May 2024 * Radix tree performance tweaks diff --git a/src/Data/Zebra/Word/Debug.hs b/src/Data/Zebra/Word/Debug.hs index e92dcc9..93d7684 100644 --- a/src/Data/Zebra/Word/Debug.hs +++ b/src/Data/Zebra/Word/Debug.hs @@ -19,7 +19,7 @@ import Numeric.Long import Radix.Word.Foundation import Radix.Word.Debug -import Debug.Trace + -- | \(\mathcal{O}(n)\). -- Shows the internal structure of the tree. diff --git a/src/Radix/Word/Debug.hs b/src/Radix/Word/Debug.hs index d1140e1..501e4ae 100644 --- a/src/Radix/Word/Debug.hs +++ b/src/Radix/Word/Debug.hs @@ -22,9 +22,9 @@ data S = L -- ^ Left. Masked bit of the prefix above this node must be @0@. validPrefix :: Prefix -> S -> Prefix -> Bool validPrefix p s o = let low = p .&. negate p - in even p && case s of - L -> o < p && p - o < low - R -> p < o && o - p < low + in case s of + L -> o < p && p - o < low + R -> p < o && o - p < low -- | Check whether the key below aligns with the side the branch is on. validKey :: Prefix -> S -> Key -> Bool diff --git a/src/Radix/Word8/Debug.hs b/src/Radix/Word8/Debug.hs index d6c2947..5e3bd40 100644 --- a/src/Radix/Word8/Debug.hs +++ b/src/Radix/Word8/Debug.hs @@ -22,9 +22,9 @@ data S = L -- ^ Left. Masked bit of the prefix above this node must be @0@. validPrefix :: Prefix -> S -> Prefix -> Bool validPrefix p s o = let low = p .&. negate p - in even p && case s of - L -> o < p && p - o < low - R -> p < o && o - p < low + in case s of + L -> o < p && p - o < low + R -> p < o && o - p < low