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

Remove unused this._ws check from _initWsCallbacks #251

Conversation

lucasrmendonca
Copy link
Contributor

@lucasrmendonca lucasrmendonca commented Jan 15, 2023

Description, Motivation and Context

This code is never reached since function connect() already checks for this._ws before safely calling _initWsCallbacks();
Also, in case there was no this._ws I'd prefer a runtime error over silently failing and returning with no error message

What kind of change does this PR introduce?

  • Refactoring (no new functionality, only code improvements)

Checklist:

  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • Overall test coverage is not decreased.
  • All new and existing tests passed.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

This check isn't needed since .connect() already checks for undefined
_ws before safely calling _initWsCallbacks;
@coveralls
Copy link

coveralls commented Jan 15, 2023

Coverage Status

Coverage: 98.056% (-0.002%) from 98.057% when pulling 21f89f6 on lucasrmendonca:removeUnnecessaryCheckFromInitWsCallbacks into 7c92a2d on KSDaemon:dev.

Copy link
Owner

@KSDaemon KSDaemon left a comment

Choose a reason for hiding this comment

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

Yeah, agree 👍🏻

@KSDaemon KSDaemon merged commit 44f72d5 into KSDaemon:dev Jan 16, 2023
@lucasrmendonca lucasrmendonca deleted the removeUnnecessaryCheckFromInitWsCallbacks branch January 16, 2023 22:31
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

3 participants