aboutsummaryrefslogtreecommitdiff
path: root/src/kompsos-collector.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2026-01-19 15:21:43 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2026-01-19 15:21:43 +1300
commitf6cc00c7e53ea5bc6fa19177bdb98ddcf25440d0 (patch)
tree6b0c302bc48801e983bca6066e1915611ca4673a /src/kompsos-collector.adb
parent0c3e440a6eaf45e83654e9d8f5471e88a2eacf77 (diff)
State now uses a Vector instead of a Map
Diffstat (limited to 'src/kompsos-collector.adb')
-rw-r--r--src/kompsos-collector.adb12
1 files changed, 7 insertions, 5 deletions
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;