Lucky hour! Grab a free trial license — offer ends in 00:59:58. Claim now
The analyzer detected equivalent expressions for the same case within the switch statement.
The example:
switch {
case s == "start", s == "start":
Start()
case s == "stop":
Stop()
}
Using equivalent expressions likes == "start" makes no sense.
true, control flow enters the branch, bypassing the second expression.false, the second expression will evaluate the same way, and control flow will skip this entire branch.Most likely, this is a typo, and the second equivalent expression should be something else.
The fixed code:
switch {
case s == "start", s == "begin":
Start()
case s == "stop":
Stop()
}
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: