Skip to content

Commit 0d0697e

Browse files
authored
HashSet.fromList: Use unsafeInsert (#515)
Fixes #514.
1 parent 1029038 commit 0d0697e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Data/HashSet/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ toList t = Exts.build (\ c z -> foldrWithKey (const . c) z (asMap t))
447447

448448
-- | \(O(n \min(W, n))\) Construct a set from a list of elements.
449449
fromList :: (Eq a, Hashable a) => [a] -> HashSet a
450-
fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
450+
fromList = HashSet . List.foldl' (\ m k -> H.unsafeInsert k () m) H.empty
451451
{-# INLINE fromList #-}
452452

453453
instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where

0 commit comments

Comments
 (0)