mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Improve string compare performance
This commit is contained in:
parent
8a803b30f6
commit
3d83cbb872
1 changed files with 3 additions and 3 deletions
|
@ -4540,9 +4540,9 @@ inline bool Server::parse_request_line(const char *s, Request &req) {
|
||||||
if (count != 3) { return false; }
|
if (count != 3) { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::set<std::string> methods{"GET", "HEAD", "POST", "PUT",
|
static const std::set<std::string> methods{
|
||||||
"DELETE", "CONNECT", "OPTIONS", "TRACE",
|
"GET", "HEAD", "POST", "PUT", "DELETE",
|
||||||
"PATCH", "PRI"};
|
"CONNECT", "OPTIONS", "TRACE", "PATCH", "PRI"};
|
||||||
|
|
||||||
if (methods.find(req.method) == methods.end()) { return false; }
|
if (methods.find(req.method) == methods.end()) { return false; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue