You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the dependency_graph.add_child_vertex the variable root is assigned:
root = !parent_names.delete(nil) { true }
This assignment does not makes sense to me.
Test Case
root
![].delete(nil) { true }
false
![nil].delete(nil) { true }
true
!["a", "b"].delete(nil) { true }
false
!["a", "b", nil].delete(nil) { true }
true
![nil, "a", "b"].delete(nil) { true }
true
If the intent is to allow a root vertex to be created using the add_child_vertex method, the criteria is that the parent_names list is empty (or for some reason only contains nil values). In general, it seems like creating a root vertex in this method is undesirable and an exception should be thrown if the parent names list is empty. In any case, the current implementation is either incorrect or a comment should be added to clarify the intent.
The text was updated successfully, but these errors were encountered:
In the
dependency_graph.add_child_vertex
the variableroot
is assigned:This assignment does not makes sense to me.
root
![].delete(nil) { true }
![nil].delete(nil) { true }
!["a", "b"].delete(nil) { true }
!["a", "b", nil].delete(nil) { true }
![nil, "a", "b"].delete(nil) { true }
If the intent is to allow a root vertex to be created using the
add_child_vertex
method, the criteria is that theparent_names
list is empty (or for some reason only containsnil
values). In general, it seems like creating a root vertex in this method is undesirable and an exception should be thrown if the parent names list is empty. In any case, the current implementation is either incorrect or a comment should be added to clarify the intent.The text was updated successfully, but these errors were encountered: