Section table is now indexed; also handled by serialize r0-1-indexedsections
authorTimm S. Mueller <tmueller@neoscientists.org>
Tue, 13 Feb 2007 01:40:34 +0100
changeset 16966d826727c2
parent 15 cbabb3a30bb6
child 17 e98290dcace2
Section table is now indexed; also handled by serialize
cgi-bin/loona.lua
cgi-bin/tek.lua
     1.1 --- a/cgi-bin/loona.lua	Tue Feb 13 00:40:43 2007 +0100
     1.2 +++ b/cgi-bin/loona.lua	Tue Feb 13 01:40:34 2007 +0100
     1.3 @@ -134,7 +134,7 @@
     1.4  		e.notvalid = (not secure and e.secure) or 
     1.5  			(not authuser and e.secret) or nil
     1.6  		e.notvisible = e.notvalid or not authuser and e.hidden or nil
     1.7 -	--	s[e.name] = e
     1.8 +		s[e.name] = e
     1.9  	end
    1.10  end
    1.11  
     2.1 --- a/cgi-bin/tek.lua	Tue Feb 13 00:40:43 2007 +0100
     2.2 +++ b/cgi-bin/tek.lua	Tue Feb 13 01:40:34 2007 +0100
     2.3 @@ -95,8 +95,14 @@
     2.4  	end
     2.5  	if sorted then
     2.6  		table.sort(set, function(a, b)
     2.7 -			if type(a.key) == "number" and type(b.key) == "number" then
     2.8 -				return a.key < b.key
     2.9 +			if type(a.key) == "number" then
    2.10 +				if type(b.key) == "number" then
    2.11 +					return a.key < b.key
    2.12 +				end
    2.13 +				return true
    2.14 +			end
    2.15 +			if type(b.key) == "number" then
    2.16 +				return
    2.17  			end
    2.18  			return a.cmp < b.cmp
    2.19  		end)