提交 814fb31d 编写于 作者: N Niels 提交者: GitHub

Merge pull request #275 from dtoma/develop

Update hexify to use array lookup instead of ternary (#270)
......@@ -5959,9 +5959,11 @@ class basic_json
// (0..f)
const auto hexify = [](const int v) -> char
{
return (v < 10)
? ('0' + static_cast<char>(v))
: ('a' + static_cast<char>((v - 10) & 0x1f));
static const char hex[16] = { '0', '1', '2', '3',
'4', '5', '6', '7',
'8', '9', 'a', 'b',
'c', 'd', 'e', 'f' };
return hex[v];
};
// print character c as \uxxxx
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册