[run_set] fix invalid iterator operations (#113)

This commit is contained in:
Ming-Hung Tsai 2018-09-05 18:21:09 +08:00 committed by Joe Thornber
parent 9837feaee5
commit 788f507e46

View File

@ -64,13 +64,13 @@ namespace base {
typename rset::const_iterator it = runs_.lower_bound(run<T>(v));
if (it->begin_ == v)
if (it != runs_.end() && it->begin_ == v)
return true;
if (it != runs_.begin()) {
it--;
if (it != runs_.end())
return it->contains(v);
}
return false;
}