Skip to content

Commit

Permalink
[clang-tidy] use braced initialization list (jbeder#883)
Browse files Browse the repository at this point in the history
Found with modernize-return-braced-init-list

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb authored Jun 15, 2020
1 parent 1bf9540 commit 6387cbc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/node_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,57 +120,57 @@ void node_data::compute_map_size() const {

const_node_iterator node_data::begin() const {
if (!m_isDefined)
return const_node_iterator();
return {};

switch (m_type) {
case NodeType::Sequence:
return const_node_iterator(m_sequence.begin());
case NodeType::Map:
return const_node_iterator(m_map.begin(), m_map.end());
default:
return const_node_iterator();
return {};
}
}

node_iterator node_data::begin() {
if (!m_isDefined)
return node_iterator();
return {};

switch (m_type) {
case NodeType::Sequence:
return node_iterator(m_sequence.begin());
case NodeType::Map:
return node_iterator(m_map.begin(), m_map.end());
default:
return node_iterator();
return {};
}
}

const_node_iterator node_data::end() const {
if (!m_isDefined)
return const_node_iterator();
return {};

switch (m_type) {
case NodeType::Sequence:
return const_node_iterator(m_sequence.end());
case NodeType::Map:
return const_node_iterator(m_map.end(), m_map.end());
default:
return const_node_iterator();
return {};
}
}

node_iterator node_data::end() {
if (!m_isDefined)
return node_iterator();
return {};

switch (m_type) {
case NodeType::Sequence:
return node_iterator(m_sequence.end());
case NodeType::Map:
return node_iterator(m_map.end(), m_map.end());
default:
return node_iterator();
return {};
}
}

Expand Down

0 comments on commit 6387cbc

Please sign in to comment.