Esme Povirk (@madewokherd) commented about dlls/mlang/mlang.c:
if (ret != S_OK) return E_FAIL; if (!cps) cps = cp;
else if ((cps & cp) != 0) cps &= cp;
else if ((cps & cp) != 0 &&
((priority_cp & cps) || !(priority_cp & cp))) cps &= cp;
I don't know mlang, but the original loop confuses me a lot. It feels to me like there shouldn't be a need to examine more than one character at a time. Since next_cp is only used at the end, couldn't the check be done in the next iteration?
I don't understand what this change does, but that may be because I don't understand the original loop.