Improve the codes for sumneko friendly

This commit is contained in:
hrsh7th
2022-05-13 19:25:00 +09:00
parent 6527e5f31b
commit 0318a3cbc1
8 changed files with 170 additions and 163 deletions

View File

@@ -3,7 +3,7 @@ local binary = {}
---Insert item to list to ordered index
---@param list any[]
---@param item any
---@param func fun(a: any, b: any): "1"|"-1"|"0"
---@param func fun(a: any, b: any): 1|-1|0
binary.insort = function(list, item, func)
table.insert(list, binary.search(list, item, func), item)
end
@@ -11,7 +11,7 @@ end
---Search suitable index from list
---@param list any[]
---@param item any
---@param func fun(a: any, b: any): "1"|"-1"|"0"
---@param func fun(a: any, b: any): 1|-1|0
---@return number
binary.search = function(list, item, func)
local s = 1