From f360b5c1e3597c7fa64aa1d4a2417b44bf555d08 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 11 Feb 2015 00:20:33 +0900 Subject: [PATCH] src: Prefer std::equal --- src/util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.cc b/src/util.cc index e007f5c4..0a6f9d79 100644 --- a/src/util.cc +++ b/src/util.cc @@ -765,7 +765,7 @@ bool select_h2(const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, const char *key, unsigned int keylen) { for (auto p = in, end = in + inlen; p + keylen <= end; p += *p + 1) { - if (memcmp(key, p, keylen) == 0) { + if (std::equal(key, key + keylen, p)) { *out = p + 1; *outlen = *p; return true;