summaryrefslogtreecommitdiff
path: root/ghc/Main.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-05 20:44:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-11 20:33:37 -0400
commita6989971379c26d8c288551d536149675e009e34 (patch)
tree3cf1f5db8494cb6408461679dc9bcd9f4d5a938d /ghc/Main.hs
parentbc41e47123b205a45385a3aa69de97ce22686423 (diff)
downloadhaskell-a6989971379c26d8c288551d536149675e009e34.tar.gz
Use a Set to represent Ways
Should make `member` queries faster and avoid messing up with missing `nubSort`. Metric Increase: hie002
Diffstat (limited to 'ghc/Main.hs')
-rw-r--r--ghc/Main.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 4c546b3afc..1ad2a26e86 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -82,6 +82,7 @@ import Control.Monad.Trans.Class
import Control.Monad.Trans.Except (throwE, runExceptT)
import Data.Char
import Data.List ( isPrefixOf, partition, intercalate )
+import qualified Data.Set as Set
import Data.Maybe
import Prelude
@@ -349,12 +350,12 @@ checkOptions mode dflags srcs objs = do
let unknown_opts = [ f | (f@('-':_), _) <- srcs ]
when (notNull unknown_opts) (unknownFlagsErr unknown_opts)
- when (notNull (filter wayRTSOnly (ways dflags))
+ when (not (Set.null (Set.filter wayRTSOnly (ways dflags)))
&& isInterpretiveMode mode) $
hPutStrLn stderr ("Warning: -debug, -threaded and -ticky are ignored by GHCi")
-- -prof and --interactive are not a good combination
- when ((filter (not . wayRTSOnly) (ways dflags) /= hostFullWays)
+ when ((Set.filter (not . wayRTSOnly) (ways dflags) /= hostFullWays)
&& isInterpretiveMode mode
&& not (gopt Opt_ExternalInterpreter dflags)) $
do throwGhcException (UsageError