Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
556a8975
Commit
556a8975
authored
Jan 30, 2016
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RAPIDJSON_UNLIKELY in Value::Accept()
parent
b5156274
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
document.h
include/rapidjson/document.h
+9
-9
No files found.
include/rapidjson/document.h
View file @
556a8975
...
...
@@ -1535,22 +1535,22 @@ public:
case
kTrueType
:
return
handler
.
Bool
(
true
);
case
kObjectType
:
if
(
!
handler
.
StartObject
(
))
if
(
RAPIDJSON_UNLIKELY
(
!
handler
.
StartObject
()
))
return
false
;
for
(
ConstMemberIterator
m
=
MemberBegin
();
m
!=
MemberEnd
();
++
m
)
{
RAPIDJSON_ASSERT
(
m
->
name
.
IsString
());
// User may change the type of name by MemberIterator.
if
(
!
handler
.
Key
(
m
->
name
.
GetString
(),
m
->
name
.
GetStringLength
(),
(
m
->
name
.
flags_
&
kCopyFlag
)
!=
0
))
if
(
RAPIDJSON_UNLIKELY
(
!
handler
.
Key
(
m
->
name
.
GetString
(),
m
->
name
.
GetStringLength
(),
(
m
->
name
.
flags_
&
kCopyFlag
)
!=
0
)
))
return
false
;
if
(
!
m
->
value
.
Accept
(
handler
))
if
(
RAPIDJSON_UNLIKELY
(
!
m
->
value
.
Accept
(
handler
)
))
return
false
;
}
return
handler
.
EndObject
(
data_
.
o
.
size
);
case
kArrayType
:
if
(
!
handler
.
StartArray
(
))
if
(
RAPIDJSON_UNLIKELY
(
!
handler
.
StartArray
()
))
return
false
;
for
(
GenericValue
*
v
=
data_
.
a
.
elements
;
v
!=
data_
.
a
.
elements
+
data_
.
a
.
size
;
++
v
)
if
(
!
v
->
Accept
(
handler
))
for
(
const
GenericValue
*
v
=
data_
.
a
.
elements
;
v
!=
data_
.
a
.
elements
+
data_
.
a
.
size
;
++
v
)
if
(
RAPIDJSON_UNLIKELY
(
!
v
->
Accept
(
handler
)
))
return
false
;
return
handler
.
EndArray
(
data_
.
a
.
size
);
...
...
@@ -1559,11 +1559,11 @@ public:
default
:
RAPIDJSON_ASSERT
(
GetType
()
==
kNumberType
);
if
(
IsInt
())
return
handler
.
Int
(
data_
.
n
.
i
.
i
);
if
(
IsDouble
())
return
handler
.
Double
(
data_
.
n
.
d
);
else
if
(
IsInt
())
return
handler
.
Int
(
data_
.
n
.
i
.
i
);
else
if
(
IsUint
())
return
handler
.
Uint
(
data_
.
n
.
u
.
u
);
else
if
(
IsInt64
())
return
handler
.
Int64
(
data_
.
n
.
i64
);
else
if
(
IsUint64
())
return
handler
.
Uint64
(
data_
.
n
.
u64
);
else
return
handler
.
Double
(
data_
.
n
.
d
);
else
return
handler
.
Uint64
(
data_
.
n
.
u64
);
}
}
...
...
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