summaryrefslogtreecommitdiff
path: root/impl/IdSet.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/IdSet.hpp')
-rw-r--r--impl/IdSet.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/impl/IdSet.hpp b/impl/IdSet.hpp
index 6ced6b3..6f6fd3f 100644
--- a/impl/IdSet.hpp
+++ b/impl/IdSet.hpp
@@ -14,7 +14,7 @@ class IdSet {
IdSet(unsigned int length)
: _length(length),
_values(new CELL_TYPE[DIV_ROUND_UP(length, CELL_SIZE)]) {
- for (unsigned int i = 0; i < _length; ++i) {
+ for (unsigned int i = 0; i < DIV_ROUND_UP(_length, CELL_SIZE); ++i) {
_values[i] = 0;
}
}
@@ -27,7 +27,7 @@ class IdSet {
IdSet(const IdSet& other) {
_length = other._length;
_values = new CELL_TYPE[DIV_ROUND_UP(_length, CELL_SIZE)];
- for (unsigned int i = 0; i < _length; ++i) {
+ for (unsigned int i = 0; i < DIV_ROUND_UP(_length, CELL_SIZE); ++i) {
_values[i] = other._values[i];
}
}
@@ -39,7 +39,7 @@ class IdSet {
_length = other._length;
_values = new CELL_TYPE[DIV_ROUND_UP(_length, CELL_SIZE)];
}
- for (unsigned int i = 0; i < _length; ++i) {
+ for (unsigned int i = 0; i < DIV_ROUND_UP(_length, CELL_SIZE); ++i) {
_values[i] = other._values[i];
}
return *this;
@@ -111,7 +111,7 @@ class IdSet {
bool operator==(const IdSet& other) const {
if (_length != other._length)
return false;
- for (unsigned int i = 0; i < _length; ++i) {
+ for (unsigned int i = 0; i < DIV_ROUND_UP(_length, CELL_SIZE); ++i) {
if (_values[i] != other._values[i])
return false;
}