From f6cc00c7e53ea5bc6fa19177bdb98ddcf25440d0 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Mon, 19 Jan 2026 15:21:43 +1300 Subject: State now uses a Vector instead of a Map --- src/kompsos-collector.adb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/kompsos-collector.adb') diff --git a/src/kompsos-collector.adb b/src/kompsos-collector.adb index 7d48196..e3c760e 100644 --- a/src/kompsos-collector.adb +++ b/src/kompsos-collector.adb @@ -65,10 +65,12 @@ package body Kompsos.Collector is procedure Walk (This : in State; - Item : in out Term) is + Item : in out Term) + is + Bound_Term : Term; begin - while Item.Kind = Var_Term and then This.Actual.Contains (Item.Var) loop - Item := This.Actual.Element (Item.Var); + while Item.Kind = Var_Term and then Lookup (This, Item.Var, Bound_Term) loop + Item := Bound_Term; end loop; end Walk; @@ -102,12 +104,12 @@ package body Kompsos.Collector is -- Unify Variable and other Terms by introducing a new substitution if Real_Left.Kind = Var_Term then Extended := Potential; - Extended.Actual.Insert (Real_Left.Var, Real_Right); + Extended.Actual.Append ((Real_Left.Var, Real_Right)); return True; end if; if Real_Right.Kind = Var_Term then Extended := Potential; - Extended.Actual.Insert (Real_Right.Var, Real_Left); + Extended.Actual.Append ((Real_Right.Var, Real_Left)); return True; end if; -- cgit