mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-08-15 15:50:26 +03:00
Remove unnecessary additional filter by matching paths
This additional filter can be removed as filtering out matches by matching path already occurs
This commit is contained in:
parent
bfca8cae19
commit
95b4e13173
@ -16,11 +16,9 @@ responsesGroupedByPath pr =
|
||||
|
||||
responseForPath :: DirectoryPrefix -> TermMatchSet -> TermMatchSet
|
||||
responseForPath s =
|
||||
filterVByPath . filterKVByPath
|
||||
filterVByPath
|
||||
where
|
||||
filterVByPath = Map.map (updateMatchesWith newMatches)
|
||||
filterKVByPath = Map.filterWithKey (const $ \a -> s `elem` allPaths a)
|
||||
allPaths = fmap (fileNameGrouping . tmPath) . trMatches
|
||||
updateMatchesWith f tr = tr { trMatches = f tr }
|
||||
newMatches = filter ((== s) . fileNameGrouping . tmPath) . trMatches
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user