Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 6, 2017
1 parent c8b4803 commit 7cfbf5b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/canopy/canopy.fs
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,10 @@ let private suggestOtherSelectors cssSelector =
|> Array.Parallel.map (fun u -> editdistance cssSelector u)
|> Array.sortBy (fun r -> - r.similarity)

if results.Length >= 5 then
results
|> Seq.take 5
|> Seq.map (fun r -> r.selector) |> List.ofSeq
|> (fun suggestions -> reporter.suggestSelectors cssSelector suggestions)
else
results
|> Seq.map (fun r -> r.selector) |> List.ofSeq
|> (fun suggestions -> reporter.suggestSelectors cssSelector suggestions)
results
|> fun xs -> if xs.Length >= 5 then Seq.take 5 xs else Array.toSeq xs
|> Seq.map (fun r -> r.selector) |> List.ofSeq
|> (fun suggestions -> reporter.suggestSelectors cssSelector suggestions)

(* documented/actions *)
let describe text =
Expand Down

0 comments on commit 7cfbf5b

Please sign in to comment.