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

Add support for is_registered() #35

Merged
merged 4 commits into from Nov 18, 2021
Merged

Add support for is_registered() #35

merged 4 commits into from Nov 18, 2021

Conversation

deian
Copy link
Member

@deian deian commented Nov 17, 2021

No description provided.

@deian deian requested a review from shravanrn November 17, 2021 22:23
@shravanrn
Copy link
Collaborator

shravanrn commented Nov 17, 2021

@deian Hmm... I wonder if is_registered is misleading. I would have thought this would mean that we are actually checking the callback tables to see if this is a valid callback index (it is in bounds)

I wonder if we want to rename this to is_not_null (or better is_null) to clarify all that we are doing is a null check and we aren't checking if the index itself is valid.

Fwiw, another option that is on the table is to support comparisons with nullptr alone which would allow cb == nullptr. Not sure if this makes sense or not though

Copy link
Collaborator

@shravanrn shravanrn left a comment

Choose a reason for hiding this comment

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

(see above comment)

@deian deian merged commit 4612962 into master Nov 18, 2021
@deian
Copy link
Member Author

deian commented Nov 18, 2021

Calling it is_unregistered; problem with is_null is that it's not obvious that unregister() sets something to null.

@deian deian deleted the is-registerd branch November 18, 2021 17:58
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