summaryrefslogtreecommitdiffstats
path: root/i18nutil
diff options
context:
space:
mode:
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