summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /editeng
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/lookuptree/Trie.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/editeng/source/lookuptree/Trie.cxx b/editeng/source/lookuptree/Trie.cxx
index 87a285fcdddc..153fe01e1c6d 100644
--- a/editeng/source/lookuptree/Trie.cxx
+++ b/editeng/source/lookuptree/Trie.cxx
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <editeng/Trie.hxx>
namespace editeng
@@ -31,8 +35,8 @@ struct TrieNode final
TrieNode* findChild(sal_Unicode aCharacter);
TrieNode* traversePath(const OUString& sPath);
void addNewChild(TrieNode* pChild);
- void collectSuggestions(const OUString& sPath, std::vector<OUString>& rSuggestionList);
- static void collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList);
+ void collectSuggestions(std::u16string_view sPath, std::vector<OUString>& rSuggestionList);
+ static void collectSuggestionsForCurrentNode(TrieNode* pCurrent, std::u16string_view sPath, vector<OUString>& rSuggestionList);
};
TrieNode::TrieNode(sal_Unicode aCharacter) :
@@ -80,7 +84,7 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter)
return nullptr;
}
-void TrieNode::collectSuggestions(const OUString& sPath, vector<OUString>& rSuggestionList)
+void TrieNode::collectSuggestions(std::u16string_view sPath, vector<OUString>& rSuggestionList)
{
// first traverse nodes for alphabet characters
for (auto const & pCurrent : mLatinArray)
@@ -97,7 +101,7 @@ void TrieNode::collectSuggestions(const OUString& sPath, vector<OUString>& rSugg
}
}
-void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector<OUString>& rSuggestionList)
+void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, std::u16string_view sPath, vector<OUString>& rSuggestionList)
{
OUString aStringPath = sPath + OUStringChar(pCurrent->mCharacter);
if(pCurrent->mMarker)
@@ -179,7 +183,7 @@ size_t Trie::size() const
if (!mRoot)
return 0;
std::vector<OUString> entries;
- mRoot->collectSuggestions(OUString(), entries);
+ mRoot->collectSuggestions(std::u16string_view(), entries);
return entries.size();
}