summaryrefslogtreecommitdiff
path: root/i18nutil
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-29 14:25:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-31 07:31:11 +0100
commit8003f8694ac7c4bc117f7ce692339534d37681f0 (patch)
treed4d3aa1aa32ebe3ead11b7df2bfcbb280cb4faff /i18nutil
parentb3c449b74f64cad8b3c0403acbe283c9a588b690 (diff)
loplugin:useuniqueptr in oneToOneMappingWithFlag
Change-Id: I729d6640c105ca43fdd2e3e702f6f62876db75e5 Reviewed-on: https://gerrit.libreoffice.org/62647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18nutil')
-rw-r--r--i18nutil/source/utility/oneToOneMapping.cxx10
1 files changed, 1 insertions, 9 deletions
diff --git a/i18nutil/source/utility/oneToOneMapping.cxx b/i18nutil/source/utility/oneToOneMapping.cxx
index 8e71ea01e418..0fdea0599004 100644
--- a/i18nutil/source/utility/oneToOneMapping.cxx
+++ b/i18nutil/source/utility/oneToOneMapping.cxx
@@ -67,11 +67,6 @@ oneToOneMappingWithFlag::oneToOneMappingWithFlag( UnicodePairWithFlag const *rpT
oneToOneMappingWithFlag::~oneToOneMappingWithFlag()
{
- if( mbHasIndex )
- {
- for (UnicodePairWithFlag const ** i : mpIndex)
- delete [] i;
- }
}
void oneToOneMappingWithFlag::makeIndex()
@@ -80,9 +75,6 @@ void oneToOneMappingWithFlag::makeIndex()
{
int current = -1;
- for (UnicodePairWithFlag const **& i : mpIndex)
- i = nullptr;
-
for( size_t k = 0; k < mnSize; k++ )
{
const int high = (mpTableWF[k].first >> 8) & 0xFF;
@@ -90,7 +82,7 @@ void oneToOneMappingWithFlag::makeIndex()
if( high != current )
{
current = high;
- mpIndex[high] = new UnicodePairWithFlag const *[256];
+ mpIndex[high].reset(new UnicodePairWithFlag const *[256]);
for (int j = 0; j < 256; ++j)
mpIndex[high][j] = nullptr;