mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-07-03 14:05:11 +02:00
Merge pull request #231 from chenxiaolong/overlap
util: merge_overlapping: Skip empty and invalid ranges
This commit is contained in:
+3
-1
@@ -70,7 +70,9 @@ where
|
||||
let mut result = Vec::<Range<T>>::new();
|
||||
|
||||
for section in sections {
|
||||
if let Some(last) = result.last_mut() {
|
||||
if section.start >= section.end {
|
||||
continue;
|
||||
} else if let Some(last) = result.last_mut() {
|
||||
if section.start <= last.end {
|
||||
last.end = last.end.max(section.end);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user