Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
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
lvzhengyang
yaml-cpp
Commits
a7a7908d
Unverified
Commit
a7a7908d
authored
Jun 16, 2020
by
Rosen Penev
Committed by
GitHub
Jun 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[clang-tidy] use auto (#888)
Found with modernize-use-auto Signed-off-by: Rosen Penev <rosenp@gmail.com>
parent
0b0bf35c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
9 deletions
+8
-9
src/directives.cpp
+1
-1
src/node_data.cpp
+4
-5
src/nodeevents.cpp
+2
-2
src/singledocparser.cpp
+1
-1
No files found.
src/directives.cpp
View file @
a7a7908d
...
@@ -5,7 +5,7 @@ Directives::Directives() : version{true, 1, 2}, tags{} {}
...
@@ -5,7 +5,7 @@ Directives::Directives() : version{true, 1, 2}, tags{} {}
const
std
::
string
Directives
::
TranslateTagHandle
(
const
std
::
string
Directives
::
TranslateTagHandle
(
const
std
::
string
&
handle
)
const
{
const
std
::
string
&
handle
)
const
{
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
tags
.
find
(
handle
);
auto
it
=
tags
.
find
(
handle
);
if
(
it
==
tags
.
end
())
{
if
(
it
==
tags
.
end
())
{
if
(
handle
==
"!!"
)
if
(
handle
==
"!!"
)
return
"tag:yaml.org,2002:"
;
return
"tag:yaml.org,2002:"
;
...
...
src/node_data.cpp
View file @
a7a7908d
...
@@ -110,9 +110,9 @@ void node_data::compute_seq_size() const {
...
@@ -110,9 +110,9 @@ void node_data::compute_seq_size() const {
}
}
void
node_data
::
compute_map_size
()
const
{
void
node_data
::
compute_map_size
()
const
{
kv_pairs
::
iterator
it
=
m_undefinedPairs
.
begin
();
auto
it
=
m_undefinedPairs
.
begin
();
while
(
it
!=
m_undefinedPairs
.
end
())
{
while
(
it
!=
m_undefinedPairs
.
end
())
{
kv_pairs
::
iterator
jt
=
std
::
next
(
it
);
auto
jt
=
std
::
next
(
it
);
if
(
it
->
first
->
is_defined
()
&&
it
->
second
->
is_defined
())
if
(
it
->
first
->
is_defined
()
&&
it
->
second
->
is_defined
())
m_undefinedPairs
.
erase
(
it
);
m_undefinedPairs
.
erase
(
it
);
it
=
jt
;
it
=
jt
;
...
@@ -248,9 +248,8 @@ bool node_data::remove(node& key, const shared_memory_holder& /* pMemory */) {
...
@@ -248,9 +248,8 @@ bool node_data::remove(node& key, const shared_memory_holder& /* pMemory */) {
if
(
m_type
!=
NodeType
::
Map
)
if
(
m_type
!=
NodeType
::
Map
)
return
false
;
return
false
;
for
(
kv_pairs
::
iterator
it
=
m_undefinedPairs
.
begin
();
for
(
auto
it
=
m_undefinedPairs
.
begin
();
it
!=
m_undefinedPairs
.
end
();)
{
it
!=
m_undefinedPairs
.
end
();)
{
auto
jt
=
std
::
next
(
it
);
kv_pairs
::
iterator
jt
=
std
::
next
(
it
);
if
(
it
->
first
->
is
(
key
))
if
(
it
->
first
->
is
(
key
))
m_undefinedPairs
.
erase
(
it
);
m_undefinedPairs
.
erase
(
it
);
it
=
jt
;
it
=
jt
;
...
...
src/nodeevents.cpp
View file @
a7a7908d
...
@@ -13,7 +13,7 @@ void NodeEvents::AliasManager::RegisterReference(const detail::node& node) {
...
@@ -13,7 +13,7 @@ void NodeEvents::AliasManager::RegisterReference(const detail::node& node) {
anchor_t
NodeEvents
::
AliasManager
::
LookupAnchor
(
anchor_t
NodeEvents
::
AliasManager
::
LookupAnchor
(
const
detail
::
node
&
node
)
const
{
const
detail
::
node
&
node
)
const
{
AnchorByIdentity
::
const_iterator
it
=
m_anchorByIdentity
.
find
(
node
.
ref
());
auto
it
=
m_anchorByIdentity
.
find
(
node
.
ref
());
if
(
it
==
m_anchorByIdentity
.
end
())
if
(
it
==
m_anchorByIdentity
.
end
())
return
0
;
return
0
;
return
it
->
second
;
return
it
->
second
;
...
@@ -92,7 +92,7 @@ void NodeEvents::Emit(const detail::node& node, EventHandler& handler,
...
@@ -92,7 +92,7 @@ void NodeEvents::Emit(const detail::node& node, EventHandler& handler,
}
}
bool
NodeEvents
::
IsAliased
(
const
detail
::
node
&
node
)
const
{
bool
NodeEvents
::
IsAliased
(
const
detail
::
node
&
node
)
const
{
RefCount
::
const_iterator
it
=
m_refCount
.
find
(
node
.
ref
());
auto
it
=
m_refCount
.
find
(
node
.
ref
());
return
it
!=
m_refCount
.
end
()
&&
it
->
second
>
1
;
return
it
!=
m_refCount
.
end
()
&&
it
->
second
>
1
;
}
}
}
// namespace YAML
}
// namespace YAML
src/singledocparser.cpp
View file @
a7a7908d
...
@@ -422,7 +422,7 @@ anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
...
@@ -422,7 +422,7 @@ anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
anchor_t
SingleDocParser
::
LookupAnchor
(
const
Mark
&
mark
,
anchor_t
SingleDocParser
::
LookupAnchor
(
const
Mark
&
mark
,
const
std
::
string
&
name
)
const
{
const
std
::
string
&
name
)
const
{
Anchors
::
const_iterator
it
=
m_anchors
.
find
(
name
);
auto
it
=
m_anchors
.
find
(
name
);
if
(
it
==
m_anchors
.
end
())
if
(
it
==
m_anchors
.
end
())
throw
ParserException
(
mark
,
ErrorMsg
::
UNKNOWN_ANCHOR
);
throw
ParserException
(
mark
,
ErrorMsg
::
UNKNOWN_ANCHOR
);
...
...
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