]> granicus.if.org Git - icu/commitdiff
ICU-21035 Delete meaningless calls to uloc_getKeywordValue().
authorFredrik Roubert <roubert@google.com>
Wed, 2 Sep 2020 19:15:56 +0000 (21:15 +0200)
committerFredrik Roubert <fredrik@roubert.name>
Thu, 3 Sep 2020 18:11:21 +0000 (20:11 +0200)
These two calls to uloc_getKeywordValue() write to the buffer "id" which
then immediately after is overwritten by calls to idForLocale() so they
can simply be removed without any loss of functionality.

icu4c/source/common/ucurr.cpp

index f64bd07a71ca8293f2049462e01fe6dacf8bb4a2..e71aa3618acd058d27ac13cd7ccd7ae760e6dd29 100644 (file)
@@ -2274,7 +2274,6 @@ ucurr_countCurrencies(const char* locale,
         // local variables
         UErrorCode localStatus = U_ZERO_ERROR;
         char id[ULOC_FULLNAME_CAPACITY];
-        uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus);
 
         // get country or country_variant in `id'
         idForLocale(locale, id, sizeof(id), ec);
@@ -2390,7 +2389,6 @@ ucurr_forLocaleAndDate(const char* locale,
             // local variables
             UErrorCode localStatus = U_ZERO_ERROR;
             char id[ULOC_FULLNAME_CAPACITY];
-            resLen = uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus);
 
             // get country or country_variant in `id'
             idForLocale(locale, id, sizeof(id), ec);