diff --git a/rust/hg-core/src/revlog/index.rs b/rust/hg-core/src/revlog/index.rs index e553cd209215e6631c66f0ab2c13a227f101bce9_cnVzdC9oZy1jb3JlL3NyYy9yZXZsb2cvaW5kZXgucnM=..61a6ef876efde761ecdfa416f3e6c81a33cc10d8_cnVzdC9oZy1jb3JlL3NyYy9yZXZsb2cvaW5kZXgucnM= 100644 --- a/rust/hg-core/src/revlog/index.rs +++ b/rust/hg-core/src/revlog/index.rs @@ -1141,7 +1141,7 @@ if parent == NULL_REVISION { continue; } - let parent_seen = &seen[parent.0 as usize]; + let parent_seen = &mut seen[parent.0 as usize]; if poison { // this block is logically equivalent to poisoning parent // and counting it as non interesting if it @@ -1149,5 +1149,5 @@ if !parent_seen.is_empty() && !parent_seen.is_poisoned() { interesting -= 1; } - seen[parent.0 as usize].poison(); + parent_seen.poison(); } else { @@ -1153,6 +1153,2 @@ } else { - // Without the `interesting` accounting, this block would - // be logically equivalent to: parent_seen |= current_seen - // The parent counts as interesting if it was not already - // known to be an ancestor (would already have counted) if parent_seen.is_empty() { @@ -1158,3 +1154,2 @@ if parent_seen.is_empty() { - seen[parent.0 as usize] = current_seen.clone(); interesting += 1; @@ -1160,4 +1155,2 @@ interesting += 1; - } else if *parent_seen != current_seen { - seen[parent.0 as usize].union(¤t_seen); } @@ -1163,4 +1156,5 @@ } + parent_seen.union(¤t_seen); } } @@ -1343,7 +1337,9 @@ } fn union(&mut self, other: &Self) { - (*self) |= *other; + if *self != *other { + (*self) |= *other; + } } fn is_full_range(&self, n: usize) -> bool {