Skip to content

Commit

Permalink
minor code cleanup: use [[fallthrough]] in switch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
dspeterson committed Dec 15, 2019
1 parent 7884604 commit 5bb528f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/base/wr/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,7 @@ bool Base::Wr::IsFatal(int err, TDisp disp,
switch (disp) {
case TDisp::AddFatal: {
fatal_if_found = true;

/* TODO: Once C++17 support is enabled, fallthrough to next case and
annotate with [[fallthrough]]. */

if (contains(err_list, err)) {
return fatal_if_found;
}

break;
[[fallthrough]];
}
case TDisp::AddNonfatal: {
if (contains(err_list, err)) {
Expand All @@ -62,11 +54,7 @@ bool Base::Wr::IsFatal(int err, TDisp disp,
}
case TDisp::Fatal: {
fatal_if_found = true;

/* TODO: Once C++17 support is enabled, fallthrough to next case and
annotate with [[fallthrough]]. */

return (contains(err_list, err) == fatal_if_found);
[[fallthrough]];
}
case TDisp::Nonfatal: {
return (contains(err_list, err) == fatal_if_found);
Expand Down

0 comments on commit 5bb528f

Please sign in to comment.