mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
In BTreeMap::eq, do not compare the elements if the sizes are different.
Reverts68a7c25078in library/ (cherry picked from commit4adcdbb58b)
This commit is contained in:
@@ -2414,7 +2414,7 @@ fn default() -> BTreeMap<K, V> {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<K: PartialEq, V: PartialEq, A: Allocator + Clone> PartialEq for BTreeMap<K, V, A> {
|
||||
fn eq(&self, other: &BTreeMap<K, V, A>) -> bool {
|
||||
self.iter().eq(other)
|
||||
self.len() == other.len() && self.iter().zip(other).all(|(a, b)| a == b)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user