Skip to content

Commit

Permalink
remove any duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
dorchard committed Aug 23, 2024
1 parent 2767ef6 commit d9ebee9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Language/Fortran/Analysis/ModGraph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ genModGraph mversion includeDirs cppOpts paths = do
pf <- parserF path contents
mapM_ (perModule path) (childrenBi pf :: [ProgramUnit ()])
pure ()
execStateT (mapM_ iter paths) modGraph0
execStateT (mapM_ iter (removeDuplicates paths)) modGraph0

removeDuplicates :: Eq a => [a] -> [a]
removeDuplicates = foldl (\ acc x -> if x `elem` acc then acc else x : acc) []

modGraphToDOT :: ModGraph -> String
modGraphToDOT ModGraph { mgGraph = gr } = unlines dot
Expand Down

0 comments on commit d9ebee9

Please sign in to comment.