43 lines
608 B
Plaintext
43 lines
608 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
switch (param)
|
|
{
|
|
case 0:
|
|
DoSomething();
|
|
break;
|
|
default: // default clause should be the first or last one
|
|
Error();
|
|
break;
|
|
case 1:
|
|
DoSomethingElse();
|
|
break;
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
switch (param)
|
|
{
|
|
case 0:
|
|
DoSomething();
|
|
break;
|
|
case 1:
|
|
DoSomethingElse();
|
|
break;
|
|
default:
|
|
Error();
|
|
break;
|
|
}
|
|
----
|
|
|
|
ifdef::rspecator-view[]
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::rspecator-view[]
|