summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/directed_graphs.adb8
-rw-r--r--src/directed_graphs.ads17
2 files changed, 13 insertions, 12 deletions
diff --git a/src/directed_graphs.adb b/src/directed_graphs.adb
index 8b59051..4b9e823 100644
--- a/src/directed_graphs.adb
+++ b/src/directed_graphs.adb
@@ -974,10 +974,8 @@ package body Directed_Graphs is
is
use type Node_Maps.Cursor;
begin
- if Impl.Checks and then Position.Container = null then
- raise Constraint_Error with "Graph does not exist";
- end if;
- if Position.Place = Node_Maps.No_Element or else
+ if Position.Container = null or else
+ Position.Place = Node_Maps.No_Element or else
not Position.Container.Contains (Node_Maps.Key (Position.Place))
then
return No_Node;
@@ -2568,7 +2566,7 @@ package body Directed_Graphs is
end if;
end loop;
raise Constraint_Error with "No unused nodes available";
- return Extended_Node_ID_Type'First;
+ return Node_ID_Type'First;
end Unused;
function Unused
diff --git a/src/directed_graphs.ads b/src/directed_graphs.ads
index 925948d..d89b647 100644
--- a/src/directed_graphs.ads
+++ b/src/directed_graphs.ads
@@ -795,8 +795,6 @@ private
type Graph_Access is access all Graph;
- Empty_Graph : constant Graph := (Ada.Finalization.Controlled with others => <>);
-
@@ -816,11 +814,6 @@ private
Position : out Cursor);
for Cursor'Read use Read;
- No_Element : constant Cursor :=
- (Container => null,
- Place => Node_Maps.No_Element,
- Sub_Index => Node_Vectors.Extended_Index'First);
-
@@ -897,6 +890,16 @@ private
+ Empty_Graph : constant Graph := (Ada.Finalization.Controlled with others => <>);
+
+ No_Element : constant Cursor :=
+ (Container => null,
+ Place => Node_Maps.No_Element,
+ Sub_Index => Node_Vectors.Extended_Index'First);
+
+
+
+
type Iterator is new Ada.Finalization.Limited_Controlled and
Graph_Iterator_Interfaces.Reversible_Iterator with
record