@@ -10,7 +10,6 @@ module Hakyll.Core.DirectedGraph
1010 , neighbours
1111 , reverse
1212 , reachableNodes
13− , sanitize
1413 ) where
1514
1615import Prelude hiding (reverse)
@@ -77,17 +76,9 @@ reachableNodes set graph = reachable (setNeighbours set) set
7776 where
7877 reachable next visited
7978 | S.null next = visited
80− | otherwise = reachable (sanitize' neighbours') (next `S.union` visited)
79+ | otherwise = reachable (sanitize neighbours') (next `S.union` visited)
8180 where
82− sanitize' = S.filter (`S.notMember` visited)
83− neighbours' = setNeighbours (sanitize' next)
81+ sanitize = S.filter (`S.notMember` visited)
82+ neighbours' = setNeighbours (sanitize next)
8483
8584 setNeighbours = S.unions . map (`neighbours` graph) . S.toList
86−
87−-- | Remove all dangling pointers, i.e. references to notes that do
88−-- not actually exist in the graph.
89−--
90−sanitize :: Ord a => DirectedGraph a -> DirectedGraph a
91−sanitize (DirectedGraph graph) = DirectedGraph $ M.map sanitize' graph
92− where
93− sanitize' (Node t n) = Node t $ S.filter (`M.member` graph) n