diff --git a/icu4c/source/i18n/persncal.cpp b/icu4c/source/i18n/persncal.cpp index 0650d4a89f60..cbd1d8e4da16 100644 --- a/icu4c/source/i18n/persncal.cpp +++ b/icu4c/source/i18n/persncal.cpp @@ -93,8 +93,8 @@ static void U_CALLCONV initLeapCorrection() { }; gMinCorrection = nonLeapYears[0]; icu::UnicodeSet prefab; - for (int32_t i = 0; i < UPRV_LENGTHOF(nonLeapYears); i++) { - prefab.add(nonLeapYears[i]); + for (auto year : nonLeapYears) { + prefab.add(year); } gLeapCorrection = prefab.cloneAsThawed(); ucln_i18n_registerCleanup(UCLN_I18N_PERSIAN_CALENDAR, calendar_persian_cleanup);