summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorLeonid Ryzhov <leoryzhov@gmail.com>2022-11-24 22:19:39 +0300
committerHossein <hossein@libreoffice.org>2022-12-19 16:39:27 +0000
commited9eef72e0f616b9c626629c4233b725ca5506ce (patch)
treea47f619a89fd64974245f33e7200c4b6a6255c00 /editeng
parentd968061f008b954f55ab9a4dd51efd5d0844b543 (diff)
tdf#145538 Use range based for loops
Change-Id: I6d04185f14c3ec72b40426bd881cac80528cc736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143244 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/lookuptree/Trie.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/editeng/source/lookuptree/Trie.cxx b/editeng/source/lookuptree/Trie.cxx
index d4d3263c72cd..6505c00e43f9 100644
--- a/editeng/source/lookuptree/Trie.cxx
+++ b/editeng/source/lookuptree/Trie.cxx
@@ -114,9 +114,8 @@ TrieNode* TrieNode::traversePath(std::u16string_view sPath)
{
TrieNode* pCurrent = this;
- for ( size_t i = 0; i < sPath.size(); i++ )
+ for ( const auto aCurrentChar : sPath )
{
- sal_Unicode aCurrentChar = sPath[i];
pCurrent = pCurrent->findChild(aCurrentChar);
if ( pCurrent == nullptr )
return nullptr;
@@ -145,11 +144,9 @@ void Trie::insert(std::u16string_view sInputString) const
// traverse the input string and modify the tree with new nodes / characters
TrieNode* pCurrent = mRoot.get();
- sal_Unicode aCurrentChar;
- for ( size_t i = 0; i < sInputString.size(); i++ )
+ for ( const auto aCurrentChar : sInputString )
{
- aCurrentChar = sInputString[i];
TrieNode* pChild = pCurrent->findChild(aCurrentChar);
if ( pChild == nullptr )
{