summaryrefslogtreecommitdiff
path: root/i18nutil
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-03 08:41:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-03 11:12:07 +0200
commite54777276d28e6bbceefa07e260926c81790938c (patch)
tree54aee65d9ab60e0dafbd574c1d0849b516af2367 /i18nutil
parent32090b018d9ff81659a4c9ed41c64109ebebe4fc (diff)
loplugin:flatten in configmgr..i18nutil
Change-Id: Idaeed33df4f1dd1b2acbdaf8a895c5d56c3ca14c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99980 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18nutil')
-rw-r--r--i18nutil/source/utility/oneToOneMapping.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/i18nutil/source/utility/oneToOneMapping.cxx b/i18nutil/source/utility/oneToOneMapping.cxx
index ea8afdeb1fcc..fbb7054d91cc 100644
--- a/i18nutil/source/utility/oneToOneMapping.cxx
+++ b/i18nutil/source/utility/oneToOneMapping.cxx
@@ -70,27 +70,27 @@ oneToOneMappingWithFlag::~oneToOneMappingWithFlag()
void oneToOneMappingWithFlag::makeIndex()
{
- if( !mbHasIndex && mpTableWF )
- {
- int current = -1;
+ if( mbHasIndex || !mpTableWF )
+ return;
+
+ int current = -1;
- for( size_t k = 0; k < mnSize; k++ )
+ for( size_t k = 0; k < mnSize; k++ )
+ {
+ const int high = (mpTableWF[k].first >> 8) & 0xFF;
+ const int low = (mpTableWF[k].first) & 0xFF;
+ if( high != current )
{
- const int high = (mpTableWF[k].first >> 8) & 0xFF;
- const int low = (mpTableWF[k].first) & 0xFF;
- if( high != current )
- {
- current = high;
- mpIndex[high].reset(new UnicodePairWithFlag const *[256]);
-
- for (int j = 0; j < 256; ++j)
- mpIndex[high][j] = nullptr;
- }
- mpIndex[high][low] = &mpTableWF[k];
- }
+ current = high;
+ mpIndex[high].reset(new UnicodePairWithFlag const *[256]);
- mbHasIndex = true;
+ for (int j = 0; j < 256; ++j)
+ mpIndex[high][j] = nullptr;
+ }
+ mpIndex[high][low] = &mpTableWF[k];
}
+
+ mbHasIndex = true;
}
sal_Unicode oneToOneMappingWithFlag::find( const sal_Unicode nKey ) const