]> granicus.if.org Git - icu/commitdiff
add a hint for sorting the units
authoryounies <younies@chromium.org>
Tue, 16 Jun 2020 19:05:23 +0000 (21:05 +0200)
committeryounies <younies@chromium.org>
Tue, 16 Jun 2020 19:05:23 +0000 (21:05 +0200)
icu4c/source/i18n/complexunitsconverter.cpp

index fb906cde587af518c3f7c160f279949cd92917bd..4a77b79a0e85898c5a6752b9c60c37116bc70a8e 100644 (file)
@@ -48,8 +48,20 @@ ComplexUnitsConverter::ComplexUnitsConverter(const MeasureUnit &inputUnit,
     auto singleUnits = outputUnits.splitToSingleUnits(length, status);
     MaybeStackVector<MeasureUnit> singleUnitsInOrder;
     for (int i = 0; i < length; ++i) {
-        // TODO(younies): ensure units being in order by the biggest unit at first.
-        // This issue is part of phase 2.
+        /**
+         *  TODO(younies): ensure units being in order by the biggest unit at first.
+         * 
+         * HINT:
+         *  MaybeStackVector<SingleUnitImpl> singleUnitsInOrder =  MeasureUnitImpl::forMeasureUnitMaybeCopy(outputUnits, status).units;
+         *      uprv_sortArray(
+         *      singleUnitsInOrder.getAlias(),
+         *      singleUnitsInOrder.length(),
+         *      sizeof(singleUnitsInOrder[0]),
+         *      compareSingleUnits,
+         *      nullptr,
+         *      false,
+         *      &status);
+         */ 
         singleUnitsInOrder.emplaceBackAndCheckErrorCode(status, singleUnits[i]);
     }