Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
畅游知识海洋
json
提交
6e1347e6
J
json
项目概览
畅游知识海洋
/
json
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
json
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6e1347e6
编写于
7月 01, 2016
作者:
N
Niels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #270
上级
814fb31d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
12 deletion
+9
-12
README.md
README.md
+1
-0
src/json.hpp
src/json.hpp
+4
-5
src/json.hpp.re2c
src/json.hpp.re2c
+4
-7
未找到文件。
README.md
浏览文件 @
6e1347e6
...
@@ -485,6 +485,7 @@ I deeply appreciate the help of the following people.
...
@@ -485,6 +485,7 @@ I deeply appreciate the help of the following people.
-
[
Tom Needham
](
https://github.com/06needhamt
)
fixed a subtle bug with MSVC 2015 which was also proposed by
[
Michael K.
](
https://github.com/Epidal
)
.
-
[
Tom Needham
](
https://github.com/06needhamt
)
fixed a subtle bug with MSVC 2015 which was also proposed by
[
Michael K.
](
https://github.com/Epidal
)
.
-
[
Mário Feroldi
](
https://github.com/thelostt
)
fixed a small typo.
-
[
Mário Feroldi
](
https://github.com/thelostt
)
fixed a small typo.
-
[
duncanwerner
](
https://github.com/duncanwerner
)
found a really embarrassing performance regression in the 2.0.0 release.
-
[
duncanwerner
](
https://github.com/duncanwerner
)
found a really embarrassing performance regression in the 2.0.0 release.
-
[
Damien
](
https://github.com/dtoma
)
fixed one of the last conversion warnings.
Thanks a lot for helping out!
Thanks a lot for helping out!
...
...
src/json.hpp
浏览文件 @
6e1347e6
...
@@ -5957,16 +5957,15 @@ class basic_json
...
@@ -5957,16 +5957,15 @@ class basic_json
{
{
// convert a number 0..15 to its hex representation
// convert a number 0..15 to its hex representation
// (0..f)
// (0..f)
const
auto
hexify
=
[](
const
int
v
)
->
char
static
const
char
hexify
[
16
]
=
{
{
return
(
v
<
10
)
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
?
(
'0'
+
static_cast
<
char
>
(
v
))
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
:
(
'a'
+
static_cast
<
char
>
((
v
-
10
)
&
0x1f
));
};
};
// print character c as \uxxxx
// print character c as \uxxxx
for
(
const
char
m
:
for
(
const
char
m
:
{
'u'
,
'0'
,
'0'
,
hexify
(
c
>>
4
),
hexify
(
c
&
0x0f
)
{
'u'
,
'0'
,
'0'
,
hexify
[
c
>>
4
],
hexify
[
c
&
0x0f
]
})
})
{
{
result
[
++
pos
]
=
m
;
result
[
++
pos
]
=
m
;
...
...
src/json.hpp.re2c
浏览文件 @
6e1347e6
...
@@ -5957,18 +5957,15 @@ class basic_json
...
@@ -5957,18 +5957,15 @@ class basic_json
{
{
// convert a number 0..15 to its hex representation
// convert a number 0..15 to its hex representation
// (0..f)
// (0..f)
const auto hexify = [](const int v) -> char
static const char hexify[16] =
{
{
static const char hex[16] = { '0', '1', '2', '3',
'0', '1', '2', '3', '4', '5', '6', '7',
'4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
'8', '9', 'a', 'b',
'c', 'd', 'e', 'f' };
return hex[v];
};
};
// print character c as \uxxxx
// print character c as \uxxxx
for (const char m :
for (const char m :
{ 'u', '0', '0', hexify
(c >> 4), hexify(c & 0x0f)
{ 'u', '0', '0', hexify
[c >> 4], hexify[c & 0x0f]
})
})
{
{
result[++pos] = m;
result[++pos] = m;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录