diff --git a/libs/evoral/evoral/Range.hpp b/libs/evoral/evoral/Range.hpp index 476970f663..230b289747 100644 --- a/libs/evoral/evoral/Range.hpp +++ b/libs/evoral/evoral/Range.hpp @@ -137,6 +137,7 @@ struct /*LIBEVORAL_API*/ Range { Range (T f, T t) : from (f), to (t) {} T from; ///< start of the range T to; ///< end of the range (inclusive: to lies inside the range) + bool empty() const { return from == to; } }; template @@ -215,7 +216,7 @@ RangeList subtract (Range range, RangeList sub) RangeList result; result.add (range); - if (sub.empty ()) { + if (sub.empty () || range.empty()) { return result; }