diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-12 01:56:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-12 13:27:11 +0000 |
commit | 6f6056b62e2107b325624832d851b09711a11dd8 (patch) | |
tree | f05901c9f0357f611940a069411ec506db14935a | |
parent | 37c6cfde4db921699a1b2660beeb581a9e963630 (diff) |
Related: fdo#55570 presumably we can attempt the insert...
and rely that it won't replace the original on pre-existing key and use the
usual .second == true flag rather than lookup and then insert on
non-pre-existing key
Change-Id: Idba65bfb2efaa5812b965a8811ff425f0b0939d8
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 4bba27869aaf..0d8ff52bd688 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2672,10 +2672,7 @@ bool SvxAutocorrWordList::Insert(SvxAutocorrWord *pWord) if ( maSet.empty() ) // use the hash { rtl::OUString aShort( pWord->GetShort() ); - bool bThere = maHash.find( aShort ) != maHash.end(); - if (!bThere) - maHash.insert( std::pair<rtl::OUString, SvxAutocorrWord *>( aShort, pWord ) ); - return !bThere; + return maHash.insert( std::pair<rtl::OUString, SvxAutocorrWord *>( aShort, pWord ) ).second; } else return maSet.insert( pWord ).second; |