Mapper, ...: use memcmp() instead of strncmp() where appropriate

Micro-optimization.
This commit is contained in:
Max Kellermann
2013-10-14 22:00:21 +02:00
parent b915e43391
commit 6fd481df97
7 changed files with 11 additions and 11 deletions

View File

@@ -78,7 +78,7 @@ HttpdClient::HandleLine(const char *line)
assert(state != RESPONSE);
if (state == REQUEST) {
if (strncmp(line, "GET /", 5) != 0) {
if (memcmp(line, "GET /", 5) != 0) {
/* only GET is supported */
LogWarning(httpd_output_domain,
"malformed request line from client");
@@ -86,7 +86,7 @@ HttpdClient::HandleLine(const char *line)
}
line = strchr(line + 5, ' ');
if (line == nullptr || strncmp(line + 1, "HTTP/", 5) != 0) {
if (line == nullptr || memcmp(line + 1, "HTTP/", 5) != 0) {
/* HTTP/0.9 without request headers */
BeginResponse();
return true;