Sha256: 96b8208b6d24bdf5cf9f77c3e9a602ee8119acf89857da291ce33b9c3366b1b3
Contents?: true
Size: 679 Bytes
Versions: 84
Compression:
Stored size: 679 Bytes
Contents
local function add_bids(root, depth) local result_data = {} if depth > 0 then local sbids if depth == tonumber(ARGV[2]) and ARGV[4] then local min, max = ARGV[4]:match('(%d+):(%d+)') sbids = redis.call('ZRANGE', 'BID-' .. root .. '-bids', min, max) else sbids = redis.call('ZRANGE', 'BID-' .. root .. '-bids', 0, tonumber(ARGV[3]) - 1) end local sub_data = {} for _,v in ipairs(sbids) do table.insert(sub_data, add_bids(v, depth - 1)) end return { root, sub_data } end return { root, result_data} end return add_bids(ARGV[1], tonumber(ARGV[2]))
Version data entries
84 entries across 84 versions & 1 rubygems