Browse Source

BI-69425 fix: 排序码表找不到的字符都放最后

es6
windy 4 years ago
parent
commit
880f348393
  1. 3
      src/core/func/function.js
  2. 2
      src/third/sort.gb2312.js

3
src/core/func/function.js

@ -135,7 +135,8 @@ _.extend(BI.Func, {
var char1 = str1[i];
var char2 = str2[i];
if (char1 !== char2) {
return BI.CODE_INDEX[char1] - BI.CODE_INDEX[char2]
// 找不到的字符都往后面放
return (BI.isNull(BI.CODE_INDEX[char1]) ? BI.MAX : BI.CODE_INDEX[char1]) - (BI.isNull(BI.CODE_INDEX[char2]) ? BI.MAX : BI.CODE_INDEX[char2]);
}
}
return len1 - len2;

2
src/third/sort.gb2312.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save