提交 112ce25e 编写于 作者: J Johannes Rieken

fix compareIgnoreCase, #18682

上级 e3cbf4e7
......@@ -338,13 +338,17 @@ export function compareIgnoreCase(a: string, b: string): number {
continue;
}
const diff = codeA - codeB;
if ((diff === 32 || diff === -32) && isAsciiLetter(codeA) && isAsciiLetter(codeB)) {
// equal -> ignoreCase
continue;
if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {
const diff = codeA - codeB;
if (diff === 32 || diff === -32) {
// equal -> ignoreCase
continue;
} else {
return diff;
}
} else {
return compare(a.toLowerCase(), b.toLowerCase());
}
return compare(a[i].toLowerCase(), b[i].toLowerCase());
}
if (a.length < b.length) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册