From 042033f1e6da22616cb76c8d950c20c9efecbad5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 28 Dec 2020 17:56:40 +0100 Subject: loplugin:stringviewparam: operator + Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- editeng/source/lookuptree/Trie.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'editeng') 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 + +#include + #include 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& rSuggestionList); - static void collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector& rSuggestionList); + void collectSuggestions(std::u16string_view sPath, std::vector& rSuggestionList); + static void collectSuggestionsForCurrentNode(TrieNode* pCurrent, std::u16string_view sPath, vector& 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& rSuggestionList) +void TrieNode::collectSuggestions(std::u16string_view sPath, vector& rSuggestionList) { // first traverse nodes for alphabet characters for (auto const & pCurrent : mLatinArray) @@ -97,7 +101,7 @@ void TrieNode::collectSuggestions(const OUString& sPath, vector& rSugg } } -void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, const OUString& sPath, vector& rSuggestionList) +void TrieNode::collectSuggestionsForCurrentNode(TrieNode* pCurrent, std::u16string_view sPath, vector& 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 entries; - mRoot->collectSuggestions(OUString(), entries); + mRoot->collectSuggestions(std::u16string_view(), entries); return entries.size(); } -- cgit