fix BlockIterator always starting at pos 0 (even if there's no Block there)
This commit is contained in:
@ -237,7 +237,13 @@ public:
|
||||
|
||||
bool operator!=(const State &other) const { return !(*this == other); }
|
||||
|
||||
BlockIterator begin() const { return BlockIterator(*this); }
|
||||
BlockIterator begin() const {
|
||||
BlockIterator it = BlockIterator(*this);
|
||||
if (!(*it).IsValid()) {
|
||||
++it;
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
BlockIterator end() const { return BlockIterator(*this, width * height); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user