projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c9b541
)
Fix trac #2680; avoid quadratic behaviour from (++)
author
Ian Lynagh
<igloo@earth.li>
Wed, 15 Oct 2008 16:32:35 +0000
(16:32 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Wed, 15 Oct 2008 16:32:35 +0000
(16:32 +0000)
compiler/iface/MkIface.lhs
patch
|
blob
|
history
diff --git
a/compiler/iface/MkIface.lhs
b/compiler/iface/MkIface.lhs
index
2aa614c
..
7edf0a6
100644
(file)
--- a/
compiler/iface/MkIface.lhs
+++ b/
compiler/iface/MkIface.lhs
@@
-820,7
+820,10
@@
mk_usage_info pit hsc_env this_mod direct_imports used_names
| otherwise
= case nameModule_maybe name of
Nothing -> pprTrace "mkUsageInfo: internal name?" (ppr name) mv_map
| otherwise
= case nameModule_maybe name of
Nothing -> pprTrace "mkUsageInfo: internal name?" (ppr name) mv_map
- Just mod -> extendModuleEnv_C (++) mv_map mod [occ]
+ Just mod -> -- We use this fiddly lambda function rather than
+ -- (++) as the argument to extendModuleEnv_C to
+ -- avoid quadratic behaviour (trac #2680)
+ extendModuleEnv_C (\xs _ -> occ:xs) mv_map mod [occ]
where occ = nameOccName name
-- We want to create a Usage for a home module if
where occ = nameOccName name
-- We want to create a Usage for a home module if