remove unneeded function

This commit is contained in:
Folkert 2022-06-06 20:37:16 +02:00
parent 49c5dbf317
commit 41e3504779
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 4 additions and 10 deletions

View file

@ -1601,8 +1601,8 @@ impl Subs {
/// Unions two keys without the possibility of failure. /// Unions two keys without the possibility of failure.
pub fn union(&mut self, left: Variable, right: Variable, desc: Descriptor) { pub fn union(&mut self, left: Variable, right: Variable, desc: Descriptor) {
let l_root = self.utable.inlined_get_root_key(left); let l_root = self.utable.root_key(left);
let r_root = self.utable.inlined_get_root_key(right); let r_root = self.utable.root_key(right);
// NOTE this swapping is intentional! most of our unifying commands are based on the elm // NOTE this swapping is intentional! most of our unifying commands are based on the elm
// source, but unify_roots is from `ena`, not the elm source. Turns out that they have // source, but unify_roots is from `ena`, not the elm source. Turns out that they have
@ -1657,7 +1657,7 @@ impl Subs {
#[inline(always)] #[inline(always)]
pub fn get_root_key(&mut self, key: Variable) -> Variable { pub fn get_root_key(&mut self, key: Variable) -> Variable {
self.utable.inlined_get_root_key(key) self.utable.root_key(key)
} }
#[inline(always)] #[inline(always)]
@ -1667,7 +1667,7 @@ impl Subs {
#[inline(always)] #[inline(always)]
pub fn set(&mut self, key: Variable, r_value: Descriptor) { pub fn set(&mut self, key: Variable, r_value: Descriptor) {
let l_key = self.utable.inlined_get_root_key(key); let l_key = self.utable.root_key(key);
// self.utable.update_value(l_key, |node| node.value = r_value); // self.utable.update_value(l_key, |node| node.value = r_value);
self.utable.set_descriptor(l_key, r_value) self.utable.set_descriptor(l_key, r_value)

View file

@ -263,12 +263,6 @@ impl UnificationTable {
self.ranks[index] self.ranks[index]
} }
// TODO remove
#[inline(always)]
pub fn inlined_get_root_key(&mut self, key: Variable) -> Variable {
self.root_key(key)
}
/// NOTE: assumes variables are root /// NOTE: assumes variables are root
pub fn unify_roots(&mut self, to: Variable, from: Variable, desc: Descriptor) { pub fn unify_roots(&mut self, to: Variable, from: Variable, desc: Descriptor) {
let from_index = from.index() as usize; let from_index = from.index() as usize;