Skip to content

Commit 0a60b50

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unreachable-break-or-return issue in proxygen/lib/http/session/test/HQSessionTestCommon.cpp +5
Summary: LLVM has two warnings `-Wunreachable-code-return` and `-Wunreachable-code-break` which identify `return` and `break` statements that cannot be reached. These compromise readability, can be misleading, and may identify bugs. This diff removes such statements. `break` was often used defensively in `switch` statements. We now have `-Wimplicit-fallthrough` [enabled globally](https://fb.workplace.com/groups/fbcode/posts/8021835991186503), which replaces this inexact practice with a compiler guarantee. The compiler used to be less intelligent and would throw an error if a function didn't return the correct type after a `throw` statement. The compiler is smarter now, so this code is unnecessary. `-Wreturn-type` is enabled globally and prevents functions from ending without an appropriate return. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: dtolnay Differential Revision: D79967323 fbshipit-source-id: 711a5a948d9205413ed65f7faf0a2bf6234e3307
1 parent 049a2e0 commit 0a60b50

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

third-party/proxygen/src/proxygen/lib/http/session/test/HQSessionTestCommon.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ folly::Optional<std::pair<UnidirectionalStreamType, size_t>> parseStreamPreface(
107107
} else {
108108
return folly::none;
109109
}
110-
break;
111110
default:
112111
break;
113112
}

0 commit comments

Comments
 (0)