Skip to content

Commit

Permalink
comment tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-tylenda-sonarsource committed Dec 20, 2024
1 parent bf27121 commit 8a37c01
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ public void visitNode(Tree tree) {
* <pre>
* case "Monday", "Tuesday":
* case "Wednesday:
* default:
* default: // considered 1 label
* </pre>
*/
private static int totalLabelCount(CaseGroupTree caseGroup) {
int total = 0;
for (CaseLabelTree label: caseGroup.labels()) {
// Use the number of labels, but `default` (which does not have any expressions)
// counts as 1 label.
int sz = label.expressions().size();
// `default` does not have any expressions, but we consider it 1 label.
total += sz > 0 ? sz : 1;
}
return total;
Expand Down

0 comments on commit 8a37c01

Please sign in to comment.