table.sort排序不对问题

自己跟自己排序的时候要返回false, 否则排序会不对

 

table.sort(arr, function(a, b)
    if a == b then
        return false
    end
    --其它排序逻辑
end)

 

posted @ 2022-03-23 21:31  yanghui01  阅读(109)  评论(0编辑  收藏  举报