Kaydet (Commit) 6f6056b6 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 37c6cfde
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment