Skip to content

Commit

Permalink
[ cleanup ] use whenJust
Browse files Browse the repository at this point in the history
  • Loading branch information
gallais committed Sep 3, 2021
1 parent d62e45d commit b35e548
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Idris/ModTree.idr
Expand Up @@ -105,8 +105,7 @@ mkBuildMods : {auto d : Ref DoneMod (StringMap ())} ->
{auto o : Ref BuildOrder (List BuildMod)} ->
ModTree -> Core ()
mkBuildMods mod
= maybe (pure ())
(\sf =>
= whenJust (sourceFile mod) $ \ sf =>
do done <- get DoneMod
case lookup sf done of
Just _ => pure ()
Expand All @@ -119,8 +118,7 @@ mkBuildMods mod
(MkBuildMod sf (nspace mod)
(map nspace (deps mod)) :: bo)
done <- get DoneMod
put DoneMod (insert sf () done))
(sourceFile mod)
put DoneMod (insert sf () done)

-- Given a main file name, return the list of modules that need to be
-- built for that main file, in the order they need to be built
Expand Down

0 comments on commit b35e548

Please sign in to comment.