mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 15:36:06 +00:00
Add some extra validation before deferring.
This commit is contained in:
parent
087e711106
commit
c9cf48b676
@ -319,6 +319,7 @@ public:
|
||||
}
|
||||
this_t& operator--()
|
||||
{
|
||||
assert(contents_);
|
||||
while(base_ == (*contents_)[turn_num_].begin())
|
||||
base_ = (*contents_)[--turn_num_].end();
|
||||
--base_;
|
||||
@ -373,6 +374,7 @@ private:
|
||||
|
||||
void init()
|
||||
{
|
||||
assert(contents_);
|
||||
while(base_ == (*contents_)[turn_num_].end() //terminates thanks to invariant
|
||||
&& turn_num_+1 < contents_->size())
|
||||
base_ = (*contents_)[++turn_num_].begin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user