Skip to content

Commit 7645fdb

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unreachable-break-or-return issue in mastermind/lefdef/TimingGraph.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: D79967119 fbshipit-source-id: 2b4bffcb80c017fbcb1b60fe1d88043f35d379cc
1 parent 0a60b50 commit 7645fdb

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

third-party/mcrouter/src/mcrouter/lib/network/AsyncTlsToPlaintextSocket.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class AsyncTlsToPlaintextSocket final : public folly::AsyncTransportWrapper {
104104
}
105105
bool isDetachable() const override {
106106
LOG(FATAL) << "Unimplemented";
107-
return false;
108107
}
109108

110109
void setSendTimeout(uint32_t sendTimeoutMs) override {

0 commit comments

Comments
 (0)