File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -309,32 +309,10 @@ impl<V> Object<V> {
309
309
}
310
310
311
311
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
-
320
312
/// Check for equality while ignoring one particular element
321
313
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
-
337
314
if self . same_pool ( other) {
315
+ let ignore = self . pool . lookup ( ignore_key) ;
338
316
self . entries
339
317
. iter ( )
340
318
. filter ( |e| e. key != TOMBSTONE_KEY && ignore. map_or ( true , |ig| e. key != ig) )
You can’t perform that action at this time.
0 commit comments