Skip to content

Commit

Permalink
Fix codacy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elshize committed Dec 21, 2023
1 parent a1ed47b commit 35330c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/pisa/intersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace intersection {
using Mask = std::bitset<MAX_QUERY_LEN_EXP>;

/// Returns a filtered copy of `query` containing only terms indicated by ones in the bit mask.
[[nodiscard]] inline auto filter(Query const& query, Mask mask) -> Query {
[[nodiscard]] inline auto filter(Query const& query, Mask const& mask) -> Query {
if (query.terms.size() > MAX_QUERY_LEN) {
throw std::invalid_argument("Queries can be at most 2^32 terms long");
}
Expand Down
3 changes: 2 additions & 1 deletion include/pisa/wand_data_compressed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class uniform_score_compressor {
m_num_docs((num_docs + 1) << quantization_bits.as_int()),
m_docs_sequences(params) {}

std::vector<uint32_t> compress_data(std::vector<float> effective_scores, float max_score) {
std::vector<uint32_t>
compress_data(std::vector<float> const& effective_scores, float max_score) {
// Partition scores.
LinearQuantizer quantizer(max_score, m_quantization_bits.as_int());
std::vector<uint32_t> score_indexes;
Expand Down
2 changes: 1 addition & 1 deletion tools/reorder_docids.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace pisa {

auto reorder_docids(ReorderDocuments args) -> int {
auto reorder_docids(ReorderDocuments const& args) -> int {
tbb::global_control c(oneapi::tbb::global_control::max_allowed_parallelism, 2);
try {
if (args.bp()) {
Expand Down

0 comments on commit 35330c4

Please sign in to comment.