| Index: media/blink/interval_map.h
|
| diff --git a/media/blink/interval_map.h b/media/blink/interval_map.h
|
| index 74cdca71cf2dbf8c71309b3ccc1a0ca8fd9c2355..e11a03ceef7abbba90dc105f6dcce49ca1da212e 100644
|
| --- a/media/blink/interval_map.h
|
| +++ b/media/blink/interval_map.h
|
| @@ -124,6 +124,8 @@
|
|
|
| // Needed to make the following construct work:
|
| // for (const auto& interval_value_pair : interval_map)
|
| + // Note however that this will skip the "end" interval, which
|
| + // is usually ok since it generally has the default value.
|
| std::pair<Interval<KeyType>, ValueType> operator*() const {
|
| return std::make_pair(interval(), value());
|
| }
|
| @@ -180,7 +182,8 @@
|
|
|
| // Increase [from..to) by |how_much|.
|
| void IncrementInterval(KeyType from, KeyType to, ValueType how_much) {
|
| - if (to <= from || how_much == 0)
|
| + DCHECK_GT(to, from);
|
| + if (how_much == 0)
|
| return;
|
| typename MapType::iterator a = MakeEntry(from);
|
| typename MapType::iterator b = MakeEntry(to);
|
| @@ -194,8 +197,7 @@
|
|
|
| // Set [from..to) to |how_much|.
|
| void SetInterval(KeyType from, KeyType to, ValueType how_much) {
|
| - if (to <= from)
|
| - return;
|
| + DCHECK_GT(to, from);
|
| typename MapType::iterator a = MakeEntry(from);
|
| typename MapType::iterator b = MakeEntry(to);
|
| a->second = how_much;
|
|
|