Skip to content

Commit

Permalink
Delfi filters
Browse files Browse the repository at this point in the history
  • Loading branch information
BHYCHIK committed Apr 18, 2017
1 parent 258c1f2 commit a8b73ea
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions delfi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local space_no = 0

function find_filters_by_regex(regex)
local cnt = 0
local t = {}
for tpl in box.space[space_no].index[0]:iterator(box.index.ALL) do

if string.find(tpl[1], regex) then
local id = box.unpack('i', tpl[0])
table.insert(t, id)
end

cnt = cnt + 1
if cnt == 1000 then
box.fiber.sleep(0)
cnt = 0
end
end

return unpack(t)
end

0 comments on commit a8b73ea

Please sign in to comment.