Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey committed Jul 15, 2020
1 parent afe61c8 commit 4af3373
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ void Converter::Move(tinyxml2::XMLElement *_elem,

if (toElemStr && !toAttrStr)
{
tinyxml2::XMLNode* cloned = DeepClone(moveFrom->GetDocument(), moveFrom);
tinyxml2::XMLNode *cloned = DeepClone(moveFrom->GetDocument(), moveFrom);
tinyxml2::XMLElement *moveTo = static_cast<tinyxml2::XMLElement*>(cloned);

moveTo->SetValue(toName);
Expand Down
10 changes: 5 additions & 5 deletions src/XmlUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace sdf
inline namespace SDF_VERSION_NAMESPACE {

/////////////////////////////////////////////////
tinyxml2::XMLNode* DeepClone(tinyxml2::XMLDocument *_doc,
const tinyxml2::XMLNode *_src)
tinyxml2::XMLNode *DeepClone(tinyxml2::XMLDocument *_doc,
const tinyxml2::XMLNode *_src)
{
if (_src == nullptr)
{
Expand All @@ -44,13 +44,13 @@ tinyxml2::XMLNode* DeepClone(tinyxml2::XMLDocument *_doc,
for (const tinyxml2::XMLNode *node = _src->FirstChild(); node != nullptr;
node = node->NextSibling())
{
auto* child_copy = DeepClone(_doc, node);
if (child_copy == nullptr)
auto *childCopy = DeepClone(_doc, node);
if (childCopy == nullptr)
{
sdferr << "Failed to clone child " << node->Value() << "\n";
return nullptr;
}
copy->InsertEndChild(child_copy);
copy->InsertEndChild(childCopy);
}

return copy;
Expand Down
2 changes: 1 addition & 1 deletion src/XmlUtils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace sdf
/// \param[in] _src The node to deep copy
/// \returns The newly copied node upon success OR
/// nullptr if an error occurs.
tinyxml2::XMLNode* DeepClone(tinyxml2::XMLDocument *_doc,
tinyxml2::XMLNode *DeepClone(tinyxml2::XMLDocument *_doc,
const tinyxml2::XMLNode *_src);
}
}
Expand Down

0 comments on commit 4af3373

Please sign in to comment.