Canonicalize range path in FileLines::intersects()

This commit is contained in:
Jonathan Behrens 2017-03-29 18:50:39 -04:00
parent b6f1b516d9
commit 36f0402bac

View File

@ -140,9 +140,12 @@ impl FileLines {
Some(ref map) => map,
};
match map.get_vec(range.file_name()) {
None => false,
Some(ranges) => ranges.iter().any(|r| r.intersects(Range::from(range))),
match canonicalize_path_string(range.file_name()).and_then(|canonical| {
map.get_vec(&canonical)
.ok_or(())
}) {
Ok(ranges) => ranges.iter().any(|r| r.intersects(Range::from(range))),
Err(_) => false,
}
}
}