aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-avls.adb
diff options
context:
space:
mode:
authorMartin Jeřábek <martin.jerabek01@gmail.com>2019-03-15 01:16:20 +0100
committertgingold <tgingold@users.noreply.github.com>2021-04-22 18:55:28 +0200
commit533911923343c79875cff1d0301516bd1e535d76 (patch)
tree4545b54f3541c174947af3df6967b2288de14a48 /src/grt/grt-avls.adb
parent2a926485e11b3081b7df9ef4855043b3363027dc (diff)
downloadghdl-533911923343c79875cff1d0301516bd1e535d76.tar.gz
ghdl-533911923343c79875cff1d0301516bd1e535d76.tar.bz2
ghdl-533911923343c79875cff1d0301516bd1e535d76.zip
grt-avls: optimize, disable debug check after insert
Diffstat (limited to 'src/grt/grt-avls.adb')
-rw-r--r--src/grt/grt-avls.adb8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/grt/grt-avls.adb b/src/grt/grt-avls.adb
index 19537c1a0..0aacb2fbf 100644
--- a/src/grt/grt-avls.adb
+++ b/src/grt/grt-avls.adb
@@ -31,6 +31,7 @@ package body Grt.Avls is
return Tree (N).Height;
end if;
end Get_Height;
+ pragma Inline (Get_Height);
procedure Check_AVL (Tree : AVL_Tree; N : AVL_Nid)
is
@@ -43,12 +44,11 @@ package body Grt.Avls is
end if;
L := Tree (N).Left;
R := Tree (N).Right;
- H := Get_Height (Tree, N);
+ H := Tree (N).Height;
if L = AVL_Nil and R = AVL_Nil then
- if Get_Height (Tree, N) /= 1 then
+ if H /= 1 then
Internal_Error ("check_AVL(1)");
end if;
- return;
elsif L = AVL_Nil then
Check_AVL (Tree, R);
if H /= Get_Height (Tree, R) + 1 or H > 2 then
@@ -215,7 +215,7 @@ package body Grt.Avls is
Internal_Error ("avls.get_node");
end if;
Insert (Tree, Cmp, N, AVL_Root, Res);
- Check_AVL (Tree, AVL_Root);
+ pragma Debug (Check_AVL (Tree, AVL_Root));
end Get_Node;
function Find_Node (Tree : AVL_Tree;