Skip to content

Commit

Permalink
Always print candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
nyonson committed Apr 6, 2023
1 parent 8510a13 commit 6b0e825
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions raiju.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,11 @@ func (r Raiju) Candidates(ctx context.Context, request CandidatesRequest) ([]Rel

sort.Sort(sort.Reverse(sortDistance(allCandidates)))

if int64(len(allCandidates)) < request.Limit {
return allCandidates, nil
candidates := allCandidates
if int64(len(allCandidates)) >= request.Limit {
candidates = allCandidates[:request.Limit]
}

candidates := allCandidates[:request.Limit]

printNodes(candidates)

return candidates, nil
Expand Down

0 comments on commit 6b0e825

Please sign in to comment.