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

make iterators safe for error handling #950

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

simonbyrne
Copy link
Collaborator

@simonbyrne simonbyrne commented Jun 7, 2022

This makes some minor changes to the iterator API functions:

@simonbyrne simonbyrne mentioned this pull request Jun 7, 2022
3 tasks
end
```
"""
function h5a_iterate(@nospecialize(f), obj_id, idx_type, order, idx = 0)
err_ref = Ref{Any}(nothing)
Copy link
Member

@musm musm Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't the reference always be an integer and instead of the isnothing checks, the value jlerr < 0 is checked done? It seems like this would avoid having to leave this as an Any reference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jlerr is the error object that is caught in the helper function, not an integer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only check it if an error is thrown, so the overhead should be minimal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for the clarification.

@simonbyrne
Copy link
Collaborator Author

Any thoughts?

@musm musm merged commit 78903b6 into JuliaIO:master Jun 8, 2022
@musm
Copy link
Member

musm commented Jun 8, 2022

Thanks!

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.

None yet

2 participants