summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp')
-rw-r--r--Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp b/Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp
index ab5f2b612c1..134b919f06e 100644
--- a/Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp
+++ b/Build/source/libs/icu/icu-src/source/i18n/dtfmtsym.cpp
@@ -1574,26 +1574,20 @@ struct CalendarDataSink : public ResourceSink {
errorCode);
if (U_FAILURE(errorCode)) { return; }
}
- LocalPointer<UnicodeString> aliasRelativePathCopy(new UnicodeString(aliasRelativePath), errorCode);
- resourcesToVisitNext->addElementX(aliasRelativePathCopy.getAlias(), errorCode);
+ LocalPointer<UnicodeString> aliasRelativePathCopy(aliasRelativePath.clone(), errorCode);
+ resourcesToVisitNext->adoptElement(aliasRelativePathCopy.orphan(), errorCode);
if (U_FAILURE(errorCode)) { return; }
- // Only release ownership after resourcesToVisitNext takes it (no error happened):
- aliasRelativePathCopy.orphan();
continue;
} else if (aliasType == SAME_CALENDAR) {
// Register same-calendar alias
if (arrays.get(aliasRelativePath) == NULL && maps.get(aliasRelativePath) == NULL) {
- LocalPointer<UnicodeString> aliasRelativePathCopy(new UnicodeString(aliasRelativePath), errorCode);
- aliasPathPairs.addElementX(aliasRelativePathCopy.getAlias(), errorCode);
+ LocalPointer<UnicodeString> aliasRelativePathCopy(aliasRelativePath.clone(), errorCode);
+ aliasPathPairs.adoptElement(aliasRelativePathCopy.orphan(), errorCode);
if (U_FAILURE(errorCode)) { return; }
- // Only release ownership after aliasPathPairs takes it (no error happened):
- aliasRelativePathCopy.orphan();
- LocalPointer<UnicodeString> keyUStringCopy(new UnicodeString(keyUString), errorCode);
- aliasPathPairs.addElementX(keyUStringCopy.getAlias(), errorCode);
+ LocalPointer<UnicodeString> keyUStringCopy(keyUString.clone(), errorCode);
+ aliasPathPairs.adoptElement(keyUStringCopy.orphan(), errorCode);
if (U_FAILURE(errorCode)) { return; }
- // Only release ownership after aliasPathPairs takes it (no error happened):
- keyUStringCopy.orphan();
}
continue;
}
@@ -1760,16 +1754,12 @@ struct CalendarDataSink : public ResourceSink {
if (U_FAILURE(errorCode)) { return; }
if (aliasType == SAME_CALENDAR) {
// Store the alias path and the current path on aliasPathPairs
- LocalPointer<UnicodeString> aliasRelativePathCopy(new UnicodeString(aliasRelativePath), errorCode);
- aliasPathPairs.addElementX(aliasRelativePathCopy.getAlias(), errorCode);
+ LocalPointer<UnicodeString> aliasRelativePathCopy(aliasRelativePath.clone(), errorCode);
+ aliasPathPairs.adoptElement(aliasRelativePathCopy.orphan(), errorCode);
if (U_FAILURE(errorCode)) { return; }
- // Only release ownership after aliasPathPairs takes it (no error happened):
- aliasRelativePathCopy.orphan();
- LocalPointer<UnicodeString> pathCopy(new UnicodeString(path), errorCode);
- aliasPathPairs.addElementX(pathCopy.getAlias(), errorCode);
+ LocalPointer<UnicodeString> pathCopy(path.clone(), errorCode);
+ aliasPathPairs.adoptElement(pathCopy.orphan(), errorCode);
if (U_FAILURE(errorCode)) { return; }
- // Only release ownership after aliasPathPairs takes it (no error happened):
- pathCopy.orphan();
// Drop the latest key on the path and continue
path.retainBetween(0, pathLength);