Save a handful of tokens and fix indentation. #2

Merged
pyrex merged 1 commits from kistaro/chameleonic:cleanup-2 into main 2022-12-17 23:51:51 +00:00
Showing only changes of commit ed62ae1b77 - Show all commits

View File

@ -22,7 +22,6 @@ function names(root)
end end
function _doall(x) function _doall(x)
for n in names(x) do for n in names(x) do
for mod in all(modules) do for mod in all(modules) do
local f=mod[n] local f=mod[n]
@ -32,13 +31,12 @@ function _doall(x)
end end
-- source: https://www.lexaloffle.com/bbs/?pid=78990 -- source: https://www.lexaloffle.com/bbs/?pid=78990
gaps={57,23,10,4,1} gaps=split"57,23,10,4,1"
--{701,301,132,57,23,10,4,1} --{701,301,132,57,23,10,4,1}
function shellsort(a) function shellsort(a)
for gap in all(gaps) do for gap in all(gaps) do
for i=gap+1,#a do for i=gap+1,#a do
local x=a[i] local x,j=a[i],i-gap
local j=i-gap
while j>=1 and a[j].key>x.key do while j>=1 and a[j].key>x.key do
a[j+gap]=a[j] a[j+gap]=a[j]
j-=gap j-=gap