Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
4f8680b5
Commit
4f8680b5
authored
Sep 09, 2011
by
Jesse Beder
Browse files
Switched operator[] access to node reference equality, not node equality
parent
ec95e61c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/value/detail/node_data.cpp
src/value/detail/node_data.cpp
+3
-3
util/value.cpp
util/value.cpp
+4
-0
No files found.
src/value/detail/node_data.cpp
View file @
4f8680b5
...
@@ -64,7 +64,7 @@ namespace YAML
...
@@ -64,7 +64,7 @@ namespace YAML
return
pMemory
->
create_node
();
return
pMemory
->
create_node
();
for
(
node_map
::
const_iterator
it
=
m_map
.
begin
();
it
!=
m_map
.
end
();
++
it
)
{
for
(
node_map
::
const_iterator
it
=
m_map
.
begin
();
it
!=
m_map
.
end
();
++
it
)
{
if
(
it
->
first
==
&
key
)
// TODO: equality?
if
(
it
->
first
->
is
(
key
))
return
*
it
->
second
;
return
*
it
->
second
;
}
}
...
@@ -88,7 +88,7 @@ namespace YAML
...
@@ -88,7 +88,7 @@ namespace YAML
}
}
for
(
node_map
::
const_iterator
it
=
m_map
.
begin
();
it
!=
m_map
.
end
();
++
it
)
{
for
(
node_map
::
const_iterator
it
=
m_map
.
begin
();
it
!=
m_map
.
end
();
++
it
)
{
if
(
it
->
first
==
&
key
)
// TODO: equality?
if
(
it
->
first
->
is
(
key
))
return
*
it
->
second
;
return
*
it
->
second
;
}
}
...
@@ -103,7 +103,7 @@ namespace YAML
...
@@ -103,7 +103,7 @@ namespace YAML
return
false
;
return
false
;
for
(
node_map
::
iterator
it
=
m_map
.
begin
();
it
!=
m_map
.
end
();
++
it
)
{
for
(
node_map
::
iterator
it
=
m_map
.
begin
();
it
!=
m_map
.
end
();
++
it
)
{
if
(
it
->
first
==
&
key
)
{
// TODO: equality?
if
(
it
->
first
->
is
(
key
)
)
{
m_map
.
erase
(
it
);
m_map
.
erase
(
it
);
return
true
;
return
true
;
}
}
...
...
util/value.cpp
View file @
4f8680b5
...
@@ -20,5 +20,9 @@ int main()
...
@@ -20,5 +20,9 @@ int main()
names
[
4
]
=
"four"
;
names
[
4
]
=
"four"
;
value
[
"names"
]
=
names
;
value
[
"names"
]
=
names
;
value
[
"this"
]
=
value
;
value
[
"this"
][
"change"
]
=
value
;
value
[
"this"
][
"change"
]
=
5
;
return
0
;
return
0
;
}
}
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