mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-22 15:58:34 +03:00
Avoid calling mapRan
and doing relation building on each call to fuzzy find
This commit is contained in:
parent
3c8534d192
commit
0010b6b585
@ -86,8 +86,9 @@ fuzzyFind query names =
|
|||||||
fmap flatten
|
fmap flatten
|
||||||
. fuzzyFinds (Name.toString . fst) query
|
. fuzzyFinds (Name.toString . fst) query
|
||||||
. Map.toList
|
. Map.toList
|
||||||
$ R.toMultimap (R.mapRan Left $ terms names)
|
-- `mapMonotonic` is safe here and saves a log n factor
|
||||||
<> R.toMultimap (R.mapRan Right $ types names)
|
$ (Set.mapMonotonic Left <$> R.toMultimap (terms names))
|
||||||
|
<> (Set.mapMonotonic Right <$> R.toMultimap (types names))
|
||||||
where
|
where
|
||||||
flatten (a, (b, c)) = (a, b, c)
|
flatten (a, (b, c)) = (a, b, c)
|
||||||
fuzzyFinds :: (a -> String) -> [String] -> [a] -> [(FZF.Alignment, a)]
|
fuzzyFinds :: (a -> String) -> [String] -> [a] -> [(FZF.Alignment, a)]
|
||||||
|
Loading…
Reference in New Issue
Block a user