diff --git a/modules/stream_filter/dash/xml/DOMHelper.cpp b/modules/stream_filter/dash/xml/DOMHelper.cpp index 52f97dd126f08fc036a86f379eb43767f3a98659..3abbf39aebc47bd2a698c3be3dfc889f15f51e7c 100644 --- a/modules/stream_filter/dash/xml/DOMHelper.cpp +++ b/modules/stream_filter/dash/xml/DOMHelper.cpp @@ -29,7 +29,7 @@ using namespace dash::xml; -std::vector<Node *> DOMHelper::getElementByTagName (Node *root, std::string name, bool selfContain) +std::vector<Node *> DOMHelper::getElementByTagName (Node *root, const std::string& name, bool selfContain) { std::vector<Node *> elements; @@ -41,20 +41,20 @@ std::vector<Node *> DOMHelper::getElementByTagName (Node *root, std::string return elements; } -std::vector<Node *> DOMHelper::getChildElementByTagName (Node *root, std::string name) +std::vector<Node *> DOMHelper::getChildElementByTagName (Node *root, const std::string& name) { std::vector<Node *> elements; for(size_t i = 0; i < root->getSubNodes().size(); i++) { - if(!root->getSubNodes().at(i)->getName().compare(name)) + if( root->getSubNodes().at(i)->getName() == name ) elements.push_back(root->getSubNodes().at(i)); } return elements; } -void DOMHelper::getElementsByTagName (Node *root, std::string name, std::vector<Node*> *elements, bool selfContain) +void DOMHelper::getElementsByTagName (Node *root, const std::string& name, std::vector<Node*> *elements, bool selfContain) { if(!selfContain && !root->getName().compare(name)) { @@ -75,7 +75,7 @@ Node* DOMHelper::getFirstChildElementByName( Node *root, const std::st { for(size_t i = 0; i < root->getSubNodes().size(); i++) { - if( !root->getSubNodes().at( i )->getName().compare( name ) ) + if( root->getSubNodes().at( i )->getName() == name ) return root->getSubNodes().at( i ); } return NULL; diff --git a/modules/stream_filter/dash/xml/DOMHelper.h b/modules/stream_filter/dash/xml/DOMHelper.h index 775b8f34ba089c89f4d3f95960bf22844d1e669b..97bb89754de2d0103b5d6d74881ee58217fddd34 100644 --- a/modules/stream_filter/dash/xml/DOMHelper.h +++ b/modules/stream_filter/dash/xml/DOMHelper.h @@ -37,12 +37,12 @@ namespace dash class DOMHelper { public: - static std::vector<Node *> getElementByTagName (Node *root, std::string name, bool selfContain); - static std::vector<Node *> getChildElementByTagName (Node *root, std::string name); + static std::vector<Node *> getElementByTagName (Node *root, const std::string& name, bool selfContain); + static std::vector<Node *> getChildElementByTagName (Node *root, const std::string& name); static Node* getFirstChildElementByName( Node *root, const std::string& name ); private: - static void getElementsByTagName(Node *root, std::string name, std::vector<Node *> *elements, bool selfContain); + static void getElementsByTagName(Node *root, const std::string& name, std::vector<Node *> *elements, bool selfContain); }; } }