Skip to content

Commit 89b386d

Browse files
generatedunixname537391475639613facebook-github-bot
authored andcommitted
xplat/proxygen/lib/http/codec/CodecUtil.h
Reviewed By: hanidamlaj Differential Revision: D83327255 fbshipit-source-id: d9e90ad94fab2d8d1abfdca218f46276b4a560f7
1 parent 0f1c78f commit 89b386d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

proxygen/lib/http/codec/CodecUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace proxygen {
2323
* Earlier versions of this table allowed ' ', '"', '/' and '}'
2424
*/
2525
// clang-format off
26-
const char CodecUtil::http_tokens[256] = {
26+
const std::array<char, 256> CodecUtil::http_tokens = {{
2727
/* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */
2828
0, 0, 0, 0, 0, 0, 0, 0,
2929
/* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */
@@ -56,7 +56,7 @@ const char CodecUtil::http_tokens[256] = {
5656
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
5757
/* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */
5858
'x', 'y', 'z', 0, '|', 1, '~', 0
59-
};
59+
}};
6060
// clang-format on
6161

6262
bool CodecUtil::hasGzipAndDeflate(const std::string& value,

proxygen/lib/http/codec/CodecUtil.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#pragma once
1010

11+
#include <array>
1112
#include <assert.h>
1213
#include <folly/Range.h>
1314
#include <folly/portability/Windows.h> // for windows compatibility: STRICT maybe defined by some win headers
@@ -38,7 +39,7 @@ class CodecUtil {
3839
public:
3940
// If these are needed elsewhere, we can move them to a more generic
4041
// namespace/class later
41-
static const char http_tokens[256];
42+
static const std::array<char, 256> http_tokens;
4243

4344
static bool validateURL(folly::ByteRange url, URLValidateMode mode) {
4445
return proxygen::validateURL(url, mode);

0 commit comments

Comments
 (0)