From a8accd36b117c0a8cadb8dc5161c5a60d62a0aeb Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 8 Apr 2011 22:17:04 +0200 Subject: Minor refactoring --- src/Hakyll/Core/DirectedGraph.hs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/Hakyll') diff --git a/src/Hakyll/Core/DirectedGraph.hs b/src/Hakyll/Core/DirectedGraph.hs index 6be5c5c..ff9121a 100644 --- a/src/Hakyll/Core/DirectedGraph.hs +++ b/src/Hakyll/Core/DirectedGraph.hs @@ -10,7 +10,6 @@ module Hakyll.Core.DirectedGraph , neighbours , reverse , reachableNodes - , sanitize ) where import Prelude hiding (reverse) @@ -77,17 +76,9 @@ reachableNodes set graph = reachable (setNeighbours set) set where reachable next visited | S.null next = visited - | otherwise = reachable (sanitize' neighbours') (next `S.union` visited) + | otherwise = reachable (sanitize neighbours') (next `S.union` visited) where - sanitize' = S.filter (`S.notMember` visited) - neighbours' = setNeighbours (sanitize' next) + sanitize = S.filter (`S.notMember` visited) + neighbours' = setNeighbours (sanitize next) setNeighbours = S.unions . map (`neighbours` graph) . S.toList - --- | Remove all dangling pointers, i.e. references to notes that do --- not actually exist in the graph. --- -sanitize :: Ord a => DirectedGraph a -> DirectedGraph a -sanitize (DirectedGraph graph) = DirectedGraph $ M.map sanitize' graph - where - sanitize' (Node t n) = Node t $ S.filter (`M.member` graph) n -- cgit v1.2.3