- uni32=NULL; // unused
- }
- FilteredNormalizer2 fn2(*n2, *uni32);
- if(normOptions&UNORM_UNICODE_3_2) {
- n2=&fn2;
- }
-
- UnicodeString str1(length1<0, s1, length1);
- UnicodeString str2(length2<0, s2, length2);
- int32_t spanQCYes1=n2->spanQuickCheckYes(str1, *pErrorCode);
- int32_t spanQCYes2=n2->spanQuickCheckYes(str2, *pErrorCode);
- if(U_FAILURE(*pErrorCode)) {
- return 0;
- }
-
- /*
- * ICU 2.4 had a further optimization:
- * If both strings were not in FCD, then they were both NFD'ed,
- * and the _COMPARE_EQUIV option was turned off.
- * It is not entirely clear that this is valid with the current
- * definition of the canonical caseless match.
- * Therefore, ICU 2.6 removes that optimization.
- */
-
- if(spanQCYes1<str1.length()) {
- UnicodeString unnormalized=str1.tempSubString(spanQCYes1);
- fcd1.setTo(FALSE, str1.getBuffer(), spanQCYes1);
- n2->normalizeSecondAndAppend(fcd1, unnormalized, *pErrorCode);
- s1=fcd1.getBuffer();
- length1=fcd1.length();
- }
- if(spanQCYes2<str2.length()) {
- UnicodeString unnormalized=str2.tempSubString(spanQCYes2);
- fcd2.setTo(FALSE, str2.getBuffer(), spanQCYes2);
- n2->normalizeSecondAndAppend(fcd2, unnormalized, *pErrorCode);
- s2=fcd2.getBuffer();
- length2=fcd2.length();
+ if(_normalize(n2, s1, length1, fcd1, pErrorCode)) {
+ s1=fcd1.getBuffer();
+ length1=fcd1.length();
+ }
+ if(_normalize(n2, s2, length2, fcd2, pErrorCode)) {
+ s2=fcd2.getBuffer();
+ length2=fcd2.length();
+ }