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
a2d09f0a
Commit
a2d09f0a
authored
May 21, 2015
by
miloyip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor GenericPointer::Erase()
parent
6e1d10ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
pointer.h
include/rapidjson/pointer.h
+13
-10
No files found.
include/rapidjson/pointer.h
View file @
a2d09f0a
...
...
@@ -686,34 +686,37 @@ public:
ValueType
*
v
=
&
root
;
const
Token
*
last
=
tokens_
+
(
tokenCount_
-
1
);
for
(
const
Token
*
t
=
tokens_
;
t
!=
tokens_
+
tokenCount_
;
++
t
)
{
for
(
const
Token
*
t
=
tokens_
;
t
!=
last
;
++
t
)
{
switch
(
v
->
GetType
())
{
case
kObjectType
:
{
typename
ValueType
::
MemberIterator
m
=
v
->
FindMember
(
GenericStringRef
<
Ch
>
(
t
->
name
,
t
->
length
));
if
(
m
==
v
->
MemberEnd
())
return
false
;
if
(
t
==
last
)
{
v
->
EraseMember
(
m
);
return
true
;
}
v
=
&
m
->
value
;
}
break
;
case
kArrayType
:
if
(
t
->
index
==
kPointerInvalidIndex
||
t
->
index
>=
v
->
Size
())
return
false
;
if
(
t
==
last
)
{
v
->
Erase
(
v
->
Begin
()
+
t
->
index
);
return
true
;
}
v
=
&
((
*
v
)[
t
->
index
]);
break
;
default
:
return
false
;
}
}
return
false
;
switch
(
v
->
GetType
())
{
case
kObjectType
:
return
v
->
EraseMember
(
GenericStringRef
<
Ch
>
(
last
->
name
,
last
->
length
));
case
kArrayType
:
if
(
last
->
index
==
kPointerInvalidIndex
||
last
->
index
>=
v
->
Size
())
return
false
;
v
->
Erase
(
v
->
Begin
()
+
last
->
index
);
return
true
;
default
:
return
false
;
}
}
private
:
...
...
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