diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-26 09:41:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 08:42:36 +0200 |
commit | 513ac8eb79e45de332d7ddab5b27c70578b904f1 (patch) | |
tree | 46f35b236d75651eb612a088e2cdfd48aa85a21c /i18npool/source/search | |
parent | SmartArt: std::for_each -> range-based for loop. (diff) | |
download | core-513ac8eb79e45de332d7ddab5b27c70578b904f1.tar.gz core-513ac8eb79e45de332d7ddab5b27c70578b904f1.zip |
loplugin:useuniqueptr in various
extending it to find places we can use std::unique_ptr on arrays
Change-Id: I9feb1d12d738d6931e752ecb6dd51cbc1540c81b
Reviewed-on: https://gerrit.libreoffice.org/39255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source/search')
-rw-r--r-- | i18npool/source/search/levdis.hxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/i18npool/source/search/levdis.hxx b/i18npool/source/search/levdis.hxx index daf8778806a3..1c4604ffd11e 100644 --- a/i18npool/source/search/levdis.hxx +++ b/i18npool/source/search/levdis.hxx @@ -96,8 +96,8 @@ /** "Safe" memory allocation in ctor */ class WLevDisPatternMem { - sal_Unicode *cp; - bool *bp; + std::unique_ptr<sal_Unicode[]> cp; + std::unique_ptr<bool[]> bp; public: explicit WLevDisPatternMem( sal_Int32 s ) : cp(new sal_Unicode[s]) @@ -105,13 +105,8 @@ public: { } - ~WLevDisPatternMem() - { - delete [] cp; - delete [] bp; - } - sal_Unicode* GetcPtr() const { return cp; } - bool* GetbPtr() const { return bp; } + sal_Unicode* GetcPtr() const { return cp.get(); } + bool* GetbPtr() const { return bp.get(); } }; class WLevDisDistanceMem |