Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #73 #77

Merged
merged 1 commit into from
Mar 10, 2024
Merged

Fix #73 #77

merged 1 commit into from
Mar 10, 2024

Conversation

stevensonmt
Copy link
Contributor

@stevensonmt stevensonmt commented Mar 10, 2024

Should fix #73. I prefer this to #75 as matching on is_struct rather than the specific Graph struct would just delay a crash if passing in %NotAGraph{}. The guards in this request are a bit more explicit.

add_vertex would loop infinitely if passed non-graph value as first parameter b/c it would always match the last function head def for add_vertex/3, which was a recursive call. Making all function heads match first parameter on %Graph{} should solve this issue.

add_vertex would loop infinitely if passed non-graph value as first parameter b/c it would always match the last function head def for add_vertex/3, which was a recursive call. Making all function heads match first parameter on %Graph{} should solve this issue.
@stevensonmt stevensonmt changed the title Fix #73 Fix https://github.com/bitwalker/libgraph/issues/73 Mar 10, 2024
@stevensonmt stevensonmt changed the title Fix https://github.com/bitwalker/libgraph/issues/73 Fix #73 Mar 10, 2024
@bitwalker bitwalker merged commit 76052b3 into bitwalker:main Mar 10, 2024
5 checks passed
@stevensonmt stevensonmt deleted the patch-1 branch March 11, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop when nil passed in as graph
2 participants