chore: add stylua to format the codebase, and run on CI (#1055)

This commit is contained in:
Kiyan
2022-03-06 17:33:30 +01:00
committed by GitHub
parent 76d181d480
commit 0816064a8b
43 changed files with 871 additions and 732 deletions

View File

@@ -26,7 +26,7 @@ local function merge(t, first, mid, last, comparator)
local j = 1
local k = first
while (i <= n1 and j <= n2) do
while i <= n1 and j <= n2 do
if comparator(ls[i], rs[j]) then
t[k] = ls[i]
i = i + 1
@@ -51,7 +51,9 @@ local function merge(t, first, mid, last, comparator)
end
local function split_merge(t, first, last, comparator)
if (last - first) < 1 then return end
if (last - first) < 1 then
return
end
local mid = math.floor((first + last) / 2)
@@ -65,7 +67,7 @@ end
---@param comparator function|nil
function M.merge_sort(t, comparator)
if not comparator then
comparator = function (left, right)
comparator = function(left, right)
return left < right
end
end