]> granicus.if.org Git - icu/commitdiff
remove std::string
authorYounies Mahmoud <younies.mahmoud@gmail.com>
Thu, 19 Mar 2020 02:28:30 +0000 (03:28 +0100)
committerYounies Mahmoud <younies.mahmoud@gmail.com>
Thu, 19 Mar 2020 02:28:30 +0000 (03:28 +0100)
icu4c/source/i18n/unitconverter.cpp

index 66b732e473922bd46f2d33ec5de3612f81b6d7ca..0ee56b8b3752873d83aae78eff0f842d51e15670 100644 (file)
@@ -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.