Commit 116134b1 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Use removeDups to find top-level duplicate names

findDupsEq is quadratic, whereas removeDups is n log n.
Fixes T1969 regression.
parent 8c550ede
......@@ -117,11 +117,11 @@ lintCoreBindings binds
-- M.n{r3} = ...
-- M.n{r29} = ...
-- becuase they both get the same linker symbol
ext_dups = findDupsEq eq_ext (map Var.varName binders)
eq_ext n1 n2 | Just m1 <- nameModule_maybe n1
, Just m2 <- nameModule_maybe n2
= m1==m2 && nameOccName n1 == nameOccName n2
| otherwise = False
ext_dups = snd (removeDups ord_ext (map Var.varName binders))
ord_ext n1 n2 | Just m1 <- nameModule_maybe n1
, Just m2 <- nameModule_maybe n2
= compare (m1, nameOccName n1) (m2, nameOccName n2)
| otherwise = LT
lint_bind (Rec prs) = mapM_ (lintSingleBinding TopLevel Recursive) prs
lint_bind (NonRec bndr rhs) = lintSingleBinding TopLevel NonRecursive (bndr,rhs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment