Skip to content

Commit 7fd3b94

Browse files
committed
refactor: Deleted unreachable code in httpserver.cpp
Removed all break statements from both RequestMethodString and GetRequestMethod functions as they were unreachable
1 parent 3eaf7be commit 7fd3b94

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/httpserver.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,12 @@ std::string RequestMethodString(HTTPRequest::RequestMethod m)
192192
switch (m) {
193193
case HTTPRequest::GET:
194194
return "GET";
195-
break;
196195
case HTTPRequest::POST:
197196
return "POST";
198-
break;
199197
case HTTPRequest::HEAD:
200198
return "HEAD";
201-
break;
202199
case HTTPRequest::PUT:
203200
return "PUT";
204-
break;
205201
default:
206202
return "unknown";
207203
}
@@ -626,19 +622,14 @@ HTTPRequest::RequestMethod HTTPRequest::GetRequestMethod() const
626622
switch (evhttp_request_get_command(req)) {
627623
case EVHTTP_REQ_GET:
628624
return GET;
629-
break;
630625
case EVHTTP_REQ_POST:
631626
return POST;
632-
break;
633627
case EVHTTP_REQ_HEAD:
634628
return HEAD;
635-
break;
636629
case EVHTTP_REQ_PUT:
637630
return PUT;
638-
break;
639631
default:
640632
return UNKNOWN;
641-
break;
642633
}
643634
}
644635

0 commit comments

Comments
 (0)