aboutsummaryrefslogtreecommitdiffstats
path: root/src/dyn_tables.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-14 18:18:27 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-14 18:18:27 +0100
commitae8e6cb6bfd4626e753c72c4f9a5673501e6184d (patch)
tree3153ab12d302085b3eace62fcedf68eed6dc7978 /src/dyn_tables.adb
parent9d3b26ba8a0d024a47f12e311b6d586e2916751b (diff)
downloadghdl-ae8e6cb6bfd4626e753c72c4f9a5673501e6184d.tar.gz
ghdl-ae8e6cb6bfd4626e753c72c4f9a5673501e6184d.tar.bz2
ghdl-ae8e6cb6bfd4626e753c72c4f9a5673501e6184d.zip
dyn_tables: minor refactoring.
Diffstat (limited to 'src/dyn_tables.adb')
-rw-r--r--src/dyn_tables.adb26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/dyn_tables.adb b/src/dyn_tables.adb
index 9af097702..c7fcc41e8 100644
--- a/src/dyn_tables.adb
+++ b/src/dyn_tables.adb
@@ -49,21 +49,21 @@ package body Dyn_Tables is
-- Check if need to reallocate.
if T.Priv.Last_Pos < T.Priv.Length then
return;
- else
- -- Double the length.
- loop
- New_Len := T.Priv.Length * 2;
-
- -- Check overflow.
- if New_Len < T.Priv.Length then
- raise Constraint_Error;
- end if;
-
- T.Priv.Length := New_Len;
- exit when New_Len > T.Priv.Last_Pos;
- end loop;
end if;
+ -- Double the length.
+ loop
+ New_Len := T.Priv.Length * 2;
+
+ -- Check overflow.
+ if New_Len < T.Priv.Length then
+ raise Constraint_Error;
+ end if;
+
+ T.Priv.Length := New_Len;
+ exit when New_Len > T.Priv.Last_Pos;
+ end loop;
+
-- Realloc and check result.
if size_t (T.Priv.Length) > size_t'Last / El_Size then
raise Constraint_Error;