diff --git a/libursa/SortedRun.cpp b/libursa/SortedRun.cpp index 9f18d70..8881867 100644 --- a/libursa/SortedRun.cpp +++ b/libursa/SortedRun.cpp @@ -51,7 +51,7 @@ void SortedRun::do_or(SortedRun &other) { other.decompress(); std::vector new_results; std::set_union(other.begin(), other.end(), begin(), end(), - std::back_inserter(new_results)); + std::back_inserter(new_results)); std::swap(new_results, sequence_); } @@ -91,7 +91,8 @@ bool IntersectionHelper::step_by_8() { return true; } - for (uint8_t *end = run_it_ + BATCH_SIZE; run_it_ < end && seq_it_ < seq_end_;) { + for (uint8_t *end = run_it_ + BATCH_SIZE; + run_it_ < end && seq_it_ < seq_end_;) { uint32_t next = prev_ + *run_it_ + 1; if (next < *seq_it_) { prev_ = next; @@ -132,8 +133,8 @@ void SortedRun::do_and(SortedRun &other) { helper.intersect(); new_end = begin() + helper.result_size(); } else { - new_end = std::set_intersection( - other.begin(), other.end(), begin(), end(), begin()); + new_end = std::set_intersection(other.begin(), other.end(), begin(), + end(), begin()); } sequence_.erase(new_end, end()); } diff --git a/libursa/SortedRun.h b/libursa/SortedRun.h index acbda32..c1d2b22 100644 --- a/libursa/SortedRun.h +++ b/libursa/SortedRun.h @@ -1,6 +1,7 @@ -#include "Core.h" #include +#include "Core.h" + uint32_t run_read(uint8_t *pos); uint8_t *run_forward(uint8_t *pos); @@ -19,7 +20,13 @@ class IntersectionHelper { public: IntersectionHelper(std::vector *seq, std::vector *run) - :run_it_(run->data()), run_end_(run->data() + run->size()), prev_(-1), seq_start_(seq->data()), seq_it_(seq->data()), seq_end_(seq->data() + seq->size()), seq_out_(seq->data()) {} + : run_it_(run->data()), + run_end_(run->data() + run->size()), + prev_(-1), + seq_start_(seq->data()), + seq_it_(seq->data()), + seq_end_(seq->data() + seq->size()), + seq_out_(seq->data()) {} size_t result_size() const { return seq_out_ - seq_start_; } void intersect();