check for identity in operator=()

Change-Id: I687dc4bdd3093054a6e2c1fd383cfc2a8c948303
This commit is contained in:
Eike Rathke 2013-09-20 13:36:33 +02:00
parent 862766d569
commit e3a01c2b0c

View file

@ -383,6 +383,9 @@ LanguageTagImpl::LanguageTagImpl( const LanguageTagImpl & rLanguageTagImpl )
LanguageTagImpl& LanguageTagImpl::operator=( const LanguageTagImpl & rLanguageTagImpl )
{
if (&rLanguageTagImpl == this)
return *this;
maLocale = rLanguageTagImpl.maLocale;
maBcp47 = rLanguageTagImpl.maBcp47;
maCachedLanguage = rLanguageTagImpl.maCachedLanguage;
@ -534,6 +537,9 @@ LanguageTag::LanguageTag( const LanguageTag & rLanguageTag )
LanguageTag& LanguageTag::operator=( const LanguageTag & rLanguageTag )
{
if (&rLanguageTag == this)
return *this;
maLocale = rLanguageTag.maLocale;
maBcp47 = rLanguageTag.maBcp47;
mnLangID = rLanguageTag.mnLangID;