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

Rename Event.set() to Event.setIfInitialized() #15800

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

denizzzka
Copy link
Contributor

@denizzzka denizzzka commented Nov 11, 2023

Proposed to rename Event.set() to Event.setIfInitialized() to better reflect behavior of this method.

Yes, it really drives me crazy when setting just doesn’t work because event isn't initialized.

Previously I already tried to do something with it: dlang/druntime#3273

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @denizzzka! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15800"

@denizzzka denizzzka marked this pull request as ready for review November 11, 2023 13:00
@maxhaton maxhaton added the 72h no objection -> merge The PR will be merged if there are no objections raised. label Nov 12, 2023
@adamdruppe
Copy link
Contributor

adamdruppe commented Nov 13, 2023

Doesn't wait require it to be initialized too?

edit: indeed it does, wait just returns false immediately if it has not been initialized, regardless of if it has been set. same as how set does nothing if it has been uninitialized. so why is set different than wait?

@denizzzka
Copy link
Contributor Author

denizzzka commented Nov 13, 2023

@adamdruppe

so why is set different than wait?

During debug I comed across set() behaviour misnaming. Then I renamed it and fixed my code and wait() worked well without my attention.

I can rename wait() by the same way. Into Event.waitIfInitialized()?

@dlang-bot dlang-bot merged commit e5148fe into dlang:master Nov 16, 2023
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
72h no objection -> merge The PR will be merged if there are no objections raised. auto-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants