X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fbuilder%2Ftree-node.cpp;h=571816aa171bd3923e646e476f6cde6a71bcff5d;hb=1de9cb6e0d9afd29e17819a6ed4b13f010faf8c3;hp=ef0071d9aefe36c25137898b0f248499989da88b;hpb=66e34be8b6c5d6e9c567e2eea8f4ed0bc9085b4b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/builder/tree-node.cpp b/dali-toolkit/devel-api/builder/tree-node.cpp index ef0071d..571816a 100644 --- a/dali-toolkit/devel-api/builder/tree-node.cpp +++ b/dali-toolkit/devel-api/builder/tree-node.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ namespace Dali { - /** * return true if the lower cased ASCII strings are equal. */ @@ -103,7 +102,7 @@ size_t TreeNode::Size() const return c; } -size_t TreeNode::Count(const std::string& childName) const +size_t TreeNode::Count(std::string_view childName) const { const TreeNode* c = GetChild(childName); if(c) @@ -116,12 +115,12 @@ size_t TreeNode::Count(const std::string& childName) const } } -const TreeNode* TreeNode::GetChild(const std::string& childName) const +const TreeNode* TreeNode::GetChild(std::string_view childName) const { const TreeNode* p = mFirstChild; while(p) { - if(p->mName && (std::string(p->mName) == childName)) + if(p->mName && (std::string_view(p->mName) == childName)) { return p; } @@ -130,7 +129,7 @@ const TreeNode* TreeNode::GetChild(const std::string& childName) const return NULL; } -const TreeNode* TreeNode::GetChildIgnoreCase(const std::string& childName) const +const TreeNode* TreeNode::GetChildIgnoreCase(std::string_view childName) const { const TreeNode* p = mFirstChild; while(p) @@ -144,9 +143,9 @@ const TreeNode* TreeNode::GetChildIgnoreCase(const std::string& childName) const return NULL; } -const TreeNode* TreeNode::Find(const std::string& childName) const +const TreeNode* TreeNode::Find(std::string_view childName) const { - if(mName && std::string(mName) == childName) + if(mName && std::string_view(mName) == childName) { return this; }