[run_set] fix invalid iterator operations (#113)
This commit is contained in:
parent
9837feaee5
commit
788f507e46
@ -64,13 +64,13 @@ namespace base {
|
|||||||
|
|
||||||
typename rset::const_iterator it = runs_.lower_bound(run<T>(v));
|
typename rset::const_iterator it = runs_.lower_bound(run<T>(v));
|
||||||
|
|
||||||
if (it->begin_ == v)
|
if (it != runs_.end() && it->begin_ == v)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
it--;
|
if (it != runs_.begin()) {
|
||||||
|
it--;
|
||||||
if (it != runs_.end())
|
|
||||||
return it->contains(v);
|
return it->contains(v);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user