check for identity in operator=()
Change-Id: I687dc4bdd3093054a6e2c1fd383cfc2a8c948303
This commit is contained in:
parent
862766d569
commit
e3a01c2b0c
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue