Skip to content

Commit 133f79a

Browse files
committed
shorten it
1 parent 203d397 commit 133f79a

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

graph/src/util/intern.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -309,32 +309,10 @@ impl<V> Object<V> {
309309
}
310310

311311
impl<V: PartialEq> Object<V> {
312-
fn len_ignore_atom(&self, atom: &Atom) -> usize {
313-
// Because of tombstones and the ignored atom, we can't just return `self.entries.len()`.
314-
self.entries
315-
.iter()
316-
.filter(|entry| entry.key != TOMBSTONE_KEY && entry.key != *atom)
317-
.count()
318-
}
319-
320312
/// Check for equality while ignoring one particular element
321313
pub fn eq_ignore_key(&self, other: &Self, ignore_key: &str) -> bool {
322-
let ignore = self.pool.lookup(ignore_key);
323-
let len1 = if let Some(to_ignore) = ignore {
324-
self.len_ignore_atom(&to_ignore)
325-
} else {
326-
self.len()
327-
};
328-
let len2 = if let Some(to_ignore) = other.pool.lookup(ignore_key) {
329-
other.len_ignore_atom(&to_ignore)
330-
} else {
331-
other.len()
332-
};
333-
if len1 != len2 {
334-
return false;
335-
}
336-
337314
if self.same_pool(other) {
315+
let ignore = self.pool.lookup(ignore_key);
338316
self.entries
339317
.iter()
340318
.filter(|e| e.key != TOMBSTONE_KEY && ignore.map_or(true, |ig| e.key != ig))

0 commit comments

Comments
 (0)