Skip to content

Conversation

jasp00
Copy link
Member

@jasp00 jasp00 commented Mar 19, 2017

Drop useless condition. Tweaks #3219.

Drop useless condition.
@tresf
Copy link
Member

tresf commented Mar 20, 2017

Then can we switch to dynamic_cast? This code could be an unsafe cast if non-File events happen. Advice appreciated.

@tresf
Copy link
Member

tresf commented Mar 20, 2017

Edit: Never-mind, I see the new logic removes the possibility for fall-through. If we properly check the cast, it should be added back in.

Also, what's the problem with the code comment?

  // Fall through to default
- // Fall through to default

This is a safe-guard comment. Switch-cases that use selective fall-through can be hard to spot or flagged as mistakes when they are not. This comment was intentional.

@tresf
Copy link
Member

tresf commented Mar 20, 2017

Doh! Nevermind.... We're already testing the type implicitly with case QEvent::FileOpen:, thus removing the need for non-obvious/bad-cast fall-through. Merging.

@tresf tresf merged commit df5cf25 into master Mar 20, 2017
@jasp00 jasp00 deleted the jasp00-patch-1 branch March 20, 2017 07:58
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
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.

2 participants