From: Matthijs Kooijman Date: Tue, 3 Mar 2009 10:56:05 +0000 (+0100) Subject: Don't add duplicate name hints. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=ca2a895b27e5cc5a3e4b4da9e94efeb9779e1e79;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Don't add duplicate name hints. --- diff --git a/FlattenTypes.hs b/FlattenTypes.hs index f75b0d5..44879d0 100644 --- a/FlattenTypes.hs +++ b/FlattenTypes.hs @@ -193,8 +193,12 @@ addNameHint :: String -> SignalId -> FlattenState () addNameHint hint id = do info <- getSignalInfo id let hints = nameHints info - let hints' = (hint:hints) - setSignalInfo id (info {nameHints = hints'}) + if hint `elem` hints + then do + return () + else do + let hints' = (hint:hints) + setSignalInfo id (info {nameHints = hints'}) -- | Returns the SignalInfo for the given signal. Errors if the signal is not -- known in the session.