optimize Eq implementation for paths
Filesystems generally have a tree-ish structure which means paths are more likely to share a prefix than a suffix. Absolute paths are especially prone to share long prefixes.
This commit is contained in:
parent
47d38752c6
commit
53d71c181e
1 changed files with 1 additions and 1 deletions
|
@ -951,7 +951,7 @@ impl FusedIterator for Components<'_> {}
|
||||||
impl<'a> cmp::PartialEq for Components<'a> {
|
impl<'a> cmp::PartialEq for Components<'a> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &Components<'a>) -> bool {
|
fn eq(&self, other: &Components<'a>) -> bool {
|
||||||
Iterator::eq(self.clone(), other.clone())
|
Iterator::eq(self.clone().rev(), other.clone().rev())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue