FileSetConfig works with empty set of roots

Closes #5139
This commit is contained in:
Aleksey Kladov 2020-07-01 09:06:51 +02:00
parent b1a2d01645
commit e336a96998

View file

@ -69,7 +69,7 @@ impl FileSetConfig {
Ok(it) => it,
Err(it) => it.saturating_sub(1),
};
if path.starts_with(&self.roots[idx].0) {
if !self.roots.is_empty() && path.starts_with(&self.roots[idx].0) {
self.roots[idx].1
} else {
self.len() - 1