unchecked in making the rank table

This commit is contained in:
Folkert 2022-05-20 23:28:56 +02:00
parent e20ac3f38f
commit a705d6a6e8
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 7 additions and 2 deletions

View file

@ -2583,8 +2583,10 @@ fn pool_to_rank_table(
// the vast majority of young variables have young_rank // the vast majority of young variables have young_rank
let mut i = 0; let mut i = 0;
while i < young_vars.len() { while i < young_vars.len() {
let var = young_vars[i]; let var = subs.get_root_key(young_vars[i]);
let rank = subs.get_rank_set_mark(var, young_mark);
subs.set_mark_unchecked(var, young_mark);
let rank = subs.get_rank_unchecked(var);
if rank != young_rank { if rank != young_rank {
debug_assert!(rank.into_usize() < young_rank.into_usize() + 1); debug_assert!(rank.into_usize() < young_rank.into_usize() + 1);

View file

@ -118,6 +118,7 @@ impl UnificationTable {
self.marks[key.index() as usize] self.marks[key.index() as usize]
} }
#[allow(unused)]
#[inline(always)] #[inline(always)]
pub fn get_copy_unchecked(&self, key: Variable) -> OptVariable { pub fn get_copy_unchecked(&self, key: Variable) -> OptVariable {
self.copies[key.index() as usize] self.copies[key.index() as usize]
@ -163,11 +164,13 @@ impl UnificationTable {
self.marks[key.index() as usize] = value; self.marks[key.index() as usize] = value;
} }
#[allow(unused)]
#[inline(always)] #[inline(always)]
pub fn set_copy_unchecked(&mut self, key: Variable, value: OptVariable) { pub fn set_copy_unchecked(&mut self, key: Variable, value: OptVariable) {
self.copies[key.index() as usize] = value; self.copies[key.index() as usize] = value;
} }
#[allow(unused)]
#[inline(always)] #[inline(always)]
pub fn set_content_unchecked(&mut self, key: Variable, value: Content) { pub fn set_content_unchecked(&mut self, key: Variable, value: Content) {
self.contents[key.index() as usize] = value; self.contents[key.index() as usize] = value;