mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-10976 Remove C++ null reference checks; they're undefined behavior.
X-SVN-Rev: 35987
This commit is contained in:
parent
03e1202db7
commit
4812b221aa
3 changed files with 9 additions and 18 deletions
|
@ -422,11 +422,6 @@ Locale &Locale::operator=(const Locale &other)
|
|||
return *this;
|
||||
}
|
||||
|
||||
if (&other == NULL) {
|
||||
this->setToBogus();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* Free our current storage */
|
||||
if(fullName != fullNameBuffer) {
|
||||
uprv_free(fullName);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
* Copyright (C) 1999-2013, International Business Machines Corporation and
|
||||
* Copyright (C) 1999-2014, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
******************************************************************************
|
||||
*
|
||||
|
@ -459,12 +459,12 @@ UnicodeString::fastCopyFrom(const UnicodeString &src) {
|
|||
UnicodeString &
|
||||
UnicodeString::copyFrom(const UnicodeString &src, UBool fastCopy) {
|
||||
// if assigning to ourselves, do nothing
|
||||
if(this == 0 || this == &src) {
|
||||
if(this == &src) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// is the right side bogus?
|
||||
if(&src == 0 || src.isBogus()) {
|
||||
if(src.isBogus()) {
|
||||
setToBogus();
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 1997-2013, International Business Machines Corporation and
|
||||
* Copyright (c) 1997-2014, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************
|
||||
*
|
||||
|
@ -786,16 +786,12 @@ MessageFormat::setFormat(const UnicodeString& formatName,
|
|||
(partIndex = nextTopLevelArgStart(partIndex)) >= 0 && U_SUCCESS(status);
|
||||
) {
|
||||
if (argNameMatches(partIndex + 1, formatName, argNumber)) {
|
||||
if (&newFormat == NULL) {
|
||||
setCustomArgStartFormat(partIndex, NULL, status);
|
||||
} else {
|
||||
Format* new_format = newFormat.clone();
|
||||
if (new_format == NULL) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
setCustomArgStartFormat(partIndex, new_format, status);
|
||||
Format* new_format = newFormat.clone();
|
||||
if (new_format == NULL) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
setCustomArgStartFormat(partIndex, new_format, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue