mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-22 15:58:34 +03:00
Merge pull request #2179 from unisonweb/fix/faster-fzf
Avoid rebuilding term and type relations on each call to fuzzy find
This commit is contained in:
commit
f1e5a630a8
@ -86,8 +86,9 @@ fuzzyFind query names =
|
||||
fmap flatten
|
||||
. fuzzyFinds (Name.toString . fst) query
|
||||
. Map.toList
|
||||
$ R.toMultimap (R.mapRan Left $ terms names)
|
||||
<> R.toMultimap (R.mapRan Right $ types names)
|
||||
-- `mapMonotonic` is safe here and saves a log n factor
|
||||
$ (Set.mapMonotonic Left <$> R.toMultimap (terms names))
|
||||
<> (Set.mapMonotonic Right <$> R.toMultimap (types names))
|
||||
where
|
||||
flatten (a, (b, c)) = (a, b, c)
|
||||
fuzzyFinds :: (a -> String) -> [String] -> [a] -> [(FZF.Alignment, a)]
|
||||
|
Loading…
Reference in New Issue
Block a user