diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2017-01-09 17:37:40 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2017-01-09 17:37:40 +0900 |
| commit | c1a0b335159a6d002f4cc35f0b66397af0f39759 (patch) | |
| tree | a31062fb3e8f486bd08552783b7a2afa0b9dab36 /src/HttpHeader.cc | |
| parent | 6abf2388ccec6332d03bb6e606227d5f527f24d9 (diff) | |
Add constexpr if possible
Diffstat (limited to 'src/HttpHeader.cc')
| -rw-r--r-- | src/HttpHeader.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index cc75e4d5..bcb6a9ec 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -220,7 +220,7 @@ bool HttpHeader::isKeepAlive() const } namespace { -const char* INTERESTING_HEADER_NAMES[] = { +constexpr const char* INTERESTING_HEADER_NAMES[] = { "accept-encoding", "access-control-request-headers", "access-control-request-method", @@ -249,9 +249,9 @@ const char* INTERESTING_HEADER_NAMES[] = { int idInterestingHeader(const char* hdName) { - const char** i = std::lower_bound(std::begin(INTERESTING_HEADER_NAMES), - std::end(INTERESTING_HEADER_NAMES), hdName, - util::strless); + auto i = std::lower_bound(std::begin(INTERESTING_HEADER_NAMES), + std::end(INTERESTING_HEADER_NAMES), hdName, + util::strless); if (i != std::end(INTERESTING_HEADER_NAMES) && strcmp(*i, hdName) == 0) { return i - std::begin(INTERESTING_HEADER_NAMES); } |
