mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
unchecked in making the rank table
This commit is contained in:
parent
e20ac3f38f
commit
a705d6a6e8
2 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue