Skip to content

Commit 2022894

Browse files
committed
fix: make query_size size_t
1 parent 7af604a commit 2022894

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/matcher.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ std::vector<size_t> computeMatch(const CandidateString &subject, const Candidate
1919
const auto &query = preparedQuery.query;
2020
const auto &query_lw = preparedQuery.query_lw;
2121

22-
// TODO making these two auto breaks the code. There are a lot of narrowing conversions in this file
2322
const auto subject_size = subject.size();
24-
const int query_size = query.size();
23+
const auto query_size = query.size();
2524

2625
// this is like the consecutive bonus, but for camelCase / snake_case initials
2726
const auto acro = scoreAcronyms(subject, subject_lw, query, query_lw);
@@ -112,8 +111,10 @@ std::vector<size_t> computeMatch(const CandidateString &subject, const Candidate
112111
// Go back in the trace matrix
113112
// and collect matches (diagonals)
114113

114+
// TODO narrowing conversions
115+
115116
int ii = subject_size - 1;
116-
auto jj = query_size - 1;
117+
int jj = query_size - 1;
117118
pos = ii * query_size + jj;
118119
auto backtrack = true;
119120
std::vector<size_t> matches;

0 commit comments

Comments
 (0)