Skip to content
Browse files

Ensure that a space leak cannot occur.

  • Loading branch information...
1 parent df3bce7 commit ce331f18cb774961d60bd111b1d6149d5f8165ae @bos committed May 31, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 Data/Configurator.hs
View
5 Data/Configurator.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE OverloadedStrings, RecordWildCards, ScopedTypeVariables #-}
+{-# LANGUAGE BangPatterns, OverloadedStrings, RecordWildCards,
+ ScopedTypeVariables #-}
-- |
-- Module: Data.Configurator
@@ -73,7 +74,7 @@ loadFiles = foldM go H.empty
where
go seen path = do
ds <- loadOne . T.unpack =<< interpolate path H.empty
- let seen' = H.insert path ds seen
+ let !seen' = H.insert path ds seen
notSeen n = not . isJust . H.lookup n $ seen
foldM go seen' . filter notSeen . importsOf $ ds

0 comments on commit ce331f1

Please sign in to comment.
Something went wrong with that request. Please try again.