diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-08 22:17:04 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-08 22:17:04 +0200 |
commit | a8accd36b117c0a8cadb8dc5161c5a60d62a0aeb (patch) | |
tree | ea8475006c8a18d068e8e3896ca9fe8affa6ae43 /src/Hakyll | |
parent | e4545f9c9e0d94ebbba3532deab1fbdc9fbe70d1 (diff) | |
download | hakyll-a8accd36b117c0a8cadb8dc5161c5a60d62a0aeb.tar.gz |
Minor refactoring
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/DirectedGraph.hs | 15 |
1 files changed, 3 insertions, 12 deletions
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 |