Skip to content

Commit 5bb528f

Browse files
committed
minor code cleanup: use [[fallthrough]] in switch statement
1 parent 7884604 commit 5bb528f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/base/wr/common.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,7 @@ bool Base::Wr::IsFatal(int err, TDisp disp,
4343
switch (disp) {
4444
case TDisp::AddFatal: {
4545
fatal_if_found = true;
46-
47-
/* TODO: Once C++17 support is enabled, fallthrough to next case and
48-
annotate with [[fallthrough]]. */
49-
50-
if (contains(err_list, err)) {
51-
return fatal_if_found;
52-
}
53-
54-
break;
46+
[[fallthrough]];
5547
}
5648
case TDisp::AddNonfatal: {
5749
if (contains(err_list, err)) {
@@ -62,11 +54,7 @@ bool Base::Wr::IsFatal(int err, TDisp disp,
6254
}
6355
case TDisp::Fatal: {
6456
fatal_if_found = true;
65-
66-
/* TODO: Once C++17 support is enabled, fallthrough to next case and
67-
annotate with [[fallthrough]]. */
68-
69-
return (contains(err_list, err) == fatal_if_found);
57+
[[fallthrough]];
7058
}
7159
case TDisp::Nonfatal: {
7260
return (contains(err_list, err) == fatal_if_found);

0 commit comments

Comments
 (0)