diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-04 15:18:26 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-05 06:27:17 +0000 |
commit | 8375affb39ac72f5a20d8a1377ccea59fe94aa73 (patch) | |
tree | 334289f729633b7878de37f932fa25bde54c12f2 /ucb/source/inc/regexpmap.hxx | |
parent | b9372f0e909c32d143540bf0ce7b79003d9b26e9 (diff) |
loplugin:constantparam in ucb
Change-Id: Ifa36b58a36232e6333a1c85d85d0372fb0de219b
Reviewed-on: https://gerrit.libreoffice.org/23829
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'ucb/source/inc/regexpmap.hxx')
-rw-r--r-- | ucb/source/inc/regexpmap.hxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx index 45a64fdb68f6..09244e6d89b2 100644 --- a/ucb/source/inc/regexpmap.hxx +++ b/ucb/source/inc/regexpmap.hxx @@ -378,7 +378,7 @@ public: RegexpMap & operator =(RegexpMap const & rOther); - void add(OUString const & rKey, Val const & rValue, bool bOverwrite); + void add(OUString const & rKey, Val const & rValue); iterator find(OUString const & rKey); @@ -424,8 +424,7 @@ RegexpMap< Val > & RegexpMap< Val >::operator =(RegexpMap const & rOther) } template< typename Val > -void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, - bool bOverwrite) +void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue) { Regexp aRegexp(Regexp::parse(rKey)); @@ -433,9 +432,7 @@ void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, { if (m_pImpl->m_pDefault) { - if (!bOverwrite) - return; - delete m_pImpl->m_pDefault; + return; } m_pImpl->m_pDefault = new Entry< Val >(aRegexp, rValue); } @@ -448,13 +445,7 @@ void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, { if (aIt->m_aRegexp == aRegexp) { - if (bOverwrite) - { - rTheList.erase(aIt); - break; - } - else - return; + return; } } |