diff --git a/Data/HashMap/Internal/Strict.hs b/Data/HashMap/Internal/Strict.hs index a7cfcdfe..dd1c41ce 100644 --- a/Data/HashMap/Internal/Strict.hs +++ b/Data/HashMap/Internal/Strict.hs @@ -401,13 +401,13 @@ alterFEager f !k !m = (<$> f mv) $ \fres -> ------------------------------ -- Update value - Just v' -> case lookupRes of + Just !v' -> case lookupRes of -- Key did not exist before, insert v' under a new key Absent -> insertNewKey h k v' m -- Key existed before, no hash collision - Present v collPos -> v' `seq` + Present v collPos -> if v `ptrEq` v' -- If the value is identical, no-op then m