Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
05ddfaf5
Commit
05ddfaf5
authored
Jul 01, 2016
by
Niels
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/improved_documentation
parents
26cab42c
6e1347e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
README.md
README.md
+1
-0
json.hpp
src/json.hpp
+4
-5
json.hpp.re2c
src/json.hpp.re2c
+4
-5
No files found.
README.md
View file @
05ddfaf5
...
@@ -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
View file @
05ddfaf5
...
@@ -6006,16 +6006,15 @@ class basic_json
...
@@ -6006,16 +6006,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
View file @
05ddfaf5
...
@@ -6006,16 +6006,15 @@ class basic_json
...
@@ -6006,16 +6006,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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment