ALGO: avoid printing KTNil for both childs

This commit is contained in:
hasufell 2014-11-30 20:04:02 +01:00
parent 968262d935
commit 78a3dd8b95
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -125,7 +125,9 @@ rangeSearch kd' sq' = (goPt kd' sq', goTree kd' sq' True)
-- A pretty rose tree suitable for printing.
goTree :: KDTree PT -> Square -> Bool -> Tree String
goTree KTNil _ _ = Node "nil" []
goTree (KTNode ln pt dir rn) sq vis =
goTree (KTNode ln pt dir rn) sq vis
| ln == KTNil && rn == KTNil = Node treeText []
| otherwise =
Node treeText
[if' (p1' dir sq < (cur' dir . unp2 $ pt))
(goTree ln sq vis)