Skip to content

Commit

Permalink
Use const CSVFormat& in calculate_score (#236)
Browse files Browse the repository at this point in the history
Co-authored-by: Asvin Goel <[email protected]>
  • Loading branch information
rajgoel and rajgoel authored Jun 15, 2024
1 parent 503d165 commit 5a05e6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/internal/csv_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace csv {
return CSVRow(std::move(rows[format.get_header()]));
}

CSV_INLINE GuessScore calculate_score(csv::string_view head, CSVFormat format) {
CSV_INLINE GuessScore calculate_score(csv::string_view head, const CSVFormat& format) {
// Frequency counter of row length
std::unordered_map<size_t, size_t> row_tally = { { 0, 0 } };

Expand Down
2 changes: 1 addition & 1 deletion include/internal/csv_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace csv {
size_t header;
};

CSV_INLINE GuessScore calculate_score(csv::string_view head, CSVFormat format);
CSV_INLINE GuessScore calculate_score(csv::string_view head, const CSVFormat& format);

CSVGuessResult _guess_format(csv::string_view head, const std::vector<char>& delims = { ',', '|', '\t', ';', '^', '~' });
}
Expand Down
4 changes: 2 additions & 2 deletions single_include/csv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6238,7 +6238,7 @@ namespace csv {
size_t header;
};

CSV_INLINE GuessScore calculate_score(csv::string_view head, CSVFormat format);
CSV_INLINE GuessScore calculate_score(csv::string_view head, const CSVFormat& format);

CSVGuessResult _guess_format(csv::string_view head, const std::vector<char>& delims = { ',', '|', '\t', ';', '^', '~' });
}
Expand Down Expand Up @@ -7359,7 +7359,7 @@ namespace csv {
return CSVRow(std::move(rows[format.get_header()]));
}

CSV_INLINE GuessScore calculate_score(csv::string_view head, CSVFormat format) {
CSV_INLINE GuessScore calculate_score(csv::string_view head, const CSVFormat& format) {
// Frequency counter of row length
std::unordered_map<size_t, size_t> row_tally = { { 0, 0 } };

Expand Down
4 changes: 2 additions & 2 deletions single_include_test/csv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6238,7 +6238,7 @@ namespace csv {
size_t header;
};

CSV_INLINE GuessScore calculate_score(csv::string_view head, CSVFormat format);
CSV_INLINE GuessScore calculate_score(csv::string_view head, const CSVFormat& format);

CSVGuessResult _guess_format(csv::string_view head, const std::vector<char>& delims = { ',', '|', '\t', ';', '^', '~' });
}
Expand Down Expand Up @@ -7359,7 +7359,7 @@ namespace csv {
return CSVRow(std::move(rows[format.get_header()]));
}

CSV_INLINE GuessScore calculate_score(csv::string_view head, CSVFormat format) {
CSV_INLINE GuessScore calculate_score(csv::string_view head, const CSVFormat& format) {
// Frequency counter of row length
std::unordered_map<size_t, size_t> row_tally = { { 0, 0 } };

Expand Down

0 comments on commit 5a05e6a

Please sign in to comment.