Browse Source

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

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '880f3483932a6e5d2550dae886326324d956d76f':
  BI-69425 fix: 排序码表找不到的字符都放最后
es6
windy 4 years ago
parent
commit
6c316116e9
  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