Skip to content

Commit

Permalink
chore: use auto where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 22, 2020
1 parent ff86e37 commit 9554380
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ struct PreparedQuery {
};

Element ToLower(const Element &s) {
string snew = string(s.size(), ' '); // new string
auto snew = string(s.size(), ' '); // new string
std::transform(s.begin(), s.end(), snew.begin(), ::tolower);
return snew;
}

Element ToUpper(const Element &s) {
string snew = string(s.size(), ' '); // new string
auto snew = string(s.size(), ' '); // new string
std::transform(s.begin(), s.end(), snew.begin(), ::toupper);
return snew;
}
Expand Down
6 changes: 3 additions & 3 deletions src/matcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ std::vector<size_t> computeMatch(const CandidateString &subject, const Candidate
csc_diag = csc_row[j];


Direction move = [&score_up, &score]() {
auto move = [&score_up, &score]() {
// In case of equality, moving UP get us closer to the start of the candidate string.
if (score > score_up) {
return Direction::LEFT;
Expand Down Expand Up @@ -125,8 +125,8 @@ std::vector<size_t> computeMatch(const CandidateString &subject, const Candidate

const auto query_size_int = static_cast<int>(query_size);

int ii = static_cast<int>(subject_size) - 1;
int jj = query_size_int - 1;
auto ii = static_cast<int>(subject_size) - 1;
auto jj = query_size_int - 1;
auto pos_ = static_cast<size_t>(ii * query_size_int + jj);
auto backtrack = true;
std::vector<size_t> matches;
Expand Down

0 comments on commit 9554380

Please sign in to comment.