Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: source/i18n/alphaindex.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/affixpatternparser.cpp ('k') | source/i18n/brktrans.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/alphaindex.cpp
diff --git a/source/i18n/alphaindex.cpp b/source/i18n/alphaindex.cpp
index 0bea1dc22fbf8cd6fa9d8620bc985e14e3e31b80..9fa98b8029b64f014a0f6f52fcb1327987c1c179 100644
--- a/source/i18n/alphaindex.cpp
+++ b/source/i18n/alphaindex.cpp
@@ -442,9 +442,8 @@ BucketList *AlphabeticIndex::createBucketList(UErrorCode &errorCode) const {
};
UBool hasPinyin = FALSE;
- LocalPointer<UVector> bucketList(new UVector(errorCode));
- if (bucketList.isNull()) {
- errorCode = U_MEMORY_ALLOCATION_ERROR;
+ LocalPointer<UVector> bucketList(new UVector(errorCode), errorCode);
+ if (U_FAILURE(errorCode)) {
return NULL;
}
bucketList->setDeleter(uprv_deleteUObject);
@@ -601,9 +600,8 @@ BucketList *AlphabeticIndex::createBucketList(UErrorCode &errorCode) const {
nextBucket = bucket;
}
- LocalPointer<UVector> publicBucketList(new UVector(errorCode));
- if (bucketList.isNull()) {
- errorCode = U_MEMORY_ALLOCATION_ERROR;
+ LocalPointer<UVector> publicBucketList(new UVector(errorCode), errorCode);
+ if (U_FAILURE(errorCode)) {
return NULL;
}
// Do not call publicBucketList->setDeleter():
@@ -990,9 +988,8 @@ UVector *AlphabeticIndex::firstStringsInScript(UErrorCode &status) {
if (U_FAILURE(status)) {
return NULL;
}
- LocalPointer<UVector> dest(new UVector(status));
- if (dest.isNull()) {
- status = U_MEMORY_ALLOCATION_ERROR;
+ LocalPointer<UVector> dest(new UVector(status), status);
+ if (U_FAILURE(status)) {
return NULL;
}
dest->setDeleter(uprv_deleteUObject);
« no previous file with comments | « source/i18n/affixpatternparser.cpp ('k') | source/i18n/brktrans.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698