From 704efa9f208e071a7d1d0e1145afdd4f19560d6e Mon Sep 17 00:00:00 2001 From: Younies Mahmoud Date: Thu, 19 Mar 2020 03:28:30 +0100 Subject: [PATCH] remove std::string --- icu4c/source/i18n/unitconverter.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/icu4c/source/i18n/unitconverter.cpp b/icu4c/source/i18n/unitconverter.cpp index 66b732e4739..0ee56b8b375 100644 --- a/icu4c/source/i18n/unitconverter.cpp +++ b/icu4c/source/i18n/unitconverter.cpp @@ -59,11 +59,6 @@ enum UnitsCase { // Returns `double` from a scientific number(i.e. "1", "2.01" or "3.09E+4") double strToDouble(StringPiece strNum) { - std::string charNum; - for (int i = 0; i < strNum.length(); i++) { - charNum += strNum.data()[i]; - } - // We are processing well-formed input, so we don't need any special options to // StringToDoubleConverter. StringToDoubleConverter converter(0, 0, 0, "", ""); @@ -435,6 +430,7 @@ StringPiece getTarget(StringPiece source, UErrorCode &status) { return convertUnit.target; } +// TODO(ICU-20568): Add more test coverage for this function. // Returns the target of a source unit. MeasureUnit extractTarget(MeasureUnit source, UErrorCode &status) { MeasureUnit result; // Empty unit. -- 2.50.1