mirror of
https://github.com/github/semantic.git
synced 2024-12-11 08:45:48 +03:00
Match the decl explicitly.
This commit is contained in:
parent
bf8f03ce37
commit
d9505164fb
@ -103,11 +103,11 @@ dedupe = let tuples = sortOn fst . Map.elems . snd . foldl' go (0, Map.empty) in
|
||||
go :: (Int, Map.Map DedupeKey (Int, (Entry, Declaration)))
|
||||
-> (Entry, Declaration)
|
||||
-> (Int, Map.Map DedupeKey (Int, (Entry, Declaration)))
|
||||
go (index, m) x | Just (_, similar) <- Map.lookup (dedupeKey (snd x)) m
|
||||
go (index, m) x | Just (_, similar@(_, similarDecl)) <- Map.lookup (dedupeKey (snd x)) m
|
||||
= if exactMatch similar x
|
||||
then (succ index, m)
|
||||
else
|
||||
(succ index, Map.insert (dedupeKey (snd similar)) (index, (Replaced, snd similar)) m)
|
||||
(succ index, Map.insert (dedupeKey similarDecl) (index, (Replaced, similarDecl)) m)
|
||||
| otherwise = (succ index, Map.insert (dedupeKey (snd x)) (index, x) m)
|
||||
|
||||
dedupeKey decl = DedupeKey (toCategoryName decl, T.toLower (declarationIdentifier decl))
|
||||
|
Loading…
Reference in New Issue
Block a user