From 6fd481df978ad4666780ef838e6c8540f6ea190f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Oct 2013 22:00:21 +0200 Subject: Mapper, ...: use memcmp() instead of strncmp() where appropriate Micro-optimization. --- src/output/HttpdClient.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/output/HttpdClient.cxx') diff --git a/src/output/HttpdClient.cxx b/src/output/HttpdClient.cxx index f7ae8d10c..5b65cc956 100644 --- a/src/output/HttpdClient.cxx +++ b/src/output/HttpdClient.cxx @@ -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; -- cgit v1.2.3