Skip to content

Commit

Permalink
chore: remove CandidateStringsVector
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 1, 2020
1 parent debf14f commit 9aa6c70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ using CandidateString = string;

using CandidateIndex = size_t;

using CandidateStringsVector = std::vector<CandidateString>;
using Score = float;

struct Options;
Expand Down Expand Up @@ -95,7 +94,7 @@ extern Score path_scorer_score(const CandidateString &string, const Element &que
extern int countDir(const CandidateString &path, int end, char pathSeparator);
extern CandidateString getExtension(const CandidateString &str);

extern std::vector<CandidateIndex> filter(const vector<CandidateStringsVector> &candidates, const Element &query, const Options &options);
extern std::vector<CandidateIndex> filter(const vector<std::vector<CandidateString>> &candidates, const Element &query, const Options &options);

extern std::vector<size_t> matcher_match(const CandidateString &string, const Element &query, const Options &options);
extern void get_wrap(const CandidateString &string, const Element &query, const Options &options, std::string *out);
6 changes: 3 additions & 3 deletions src/filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct CandidateScore {

using CandidateScorePriorityQueue = std::priority_queue<CandidateScore>;

void filter_internal(const CandidateStringsVector &candidates,
void filter_internal(const std::vector<CandidateString> &candidates,
size_t start_index,
const Element &query, const Options &options,
size_t max_results,
Expand All @@ -37,7 +37,7 @@ void filter_internal(const CandidateStringsVector &candidates,
}
}

void thread_worker_filter(const CandidateStringsVector&candidates,
void thread_worker_filter(const std::vector<CandidateString>&candidates,
size_t start_index,
const Element &query, const Options &options,
size_t max_results,
Expand All @@ -64,7 +64,7 @@ std::vector<CandidateIndex> sort_priority_queue(CandidateScorePriorityQueue &can

} // namespace

std::vector<CandidateIndex> filter(const vector<CandidateStringsVector> &candidates, const Element &query, const Options &options) {
std::vector<CandidateIndex> filter(const vector<std::vector<CandidateString>> &candidates, const Element &query, const Options &options) {
CandidateScorePriorityQueue top_k;
size_t max_results = options.max_results;
if (!max_results)
Expand Down
2 changes: 1 addition & 1 deletion src/fuzzaldrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Fuzzaldrin : public Napi::ObjectWrap<Fuzzaldrin> {
Napi::Value SetCandidates(const Napi::CallbackInfo& info);

private:
vector<CandidateStringsVector> candidates_;
vector<std::vector<CandidateString>> candidates_;
};

#endif // FUZZALDRIN_H

0 comments on commit 9aa6c70

Please sign in to comment.