Skip to content

Commit

Permalink
Fixing typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Mar 4, 2017
1 parent 12c992e commit e81b3fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/concise.h
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ class ConciseSetBitForwardIterator {
if(word_value != 0) {
uint32_t t = word_value & (-word_value);
has_value = true;
current_value = word_location * 32 + __builtin_popcount(t - 1);
current_value = word_location * 31 + __builtin_popcount(t - 1);
word_value ^= t;
} else {
has_value = false;
Expand Down
17 changes: 17 additions & 0 deletions tests/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,27 @@ template<bool ewahmode>
static bool equals(std::set<uint32_t> s, ConciseSet<ewahmode> c) {
if (s.size() != c.size())
return false;
// we go one way
for (std::set<uint32_t>::iterator i = s.begin(); i != s.end(); i++) {
if (!c.contains(*i))
return false;
}
// we go both ways
std::set<uint32_t>::iterator a = s.begin();
auto b = c.begin();
for (; (a != s.end()) && (b != c.end()); a++, b++) {
if (*a != *b) {
return false;
}
}

// we go another way
for (auto i = c.begin(); i != c.end(); i++) {
if (s.find(*i) == s.end()) {
std::cout << " There is probably an issue with the ConciseSet iterators? " << std::endl;
return false;
}
}
return true;
}

Expand Down

0 comments on commit e81b3fa

Please sign in to comment.