table.foreach is deprecated: now use for + pairs

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
TsT 2012-03-06 00:07:41 +01:00 committed by Uli Schlachter
parent d89b7bb861
commit 7a837bd2a6
1 changed files with 4 additions and 3 deletions

View File

@ -11,6 +11,7 @@ local os = os
local table = table
local math = math
local print = print
local pairs = pairs
local util = require("awful.util")
--- Completion module.
@ -172,11 +173,11 @@ function generic(text, cur_pos, ncomp, keywords)
-- Filter out only keywords starting with text
local matches = {}
table.foreach(keywords, function(_, x)
for _, x in pairs(keywords) do
if x:sub(1, #text) == text then
table.insert(matches, x)
end
end)
end
-- if there are no matches just leave out with the current text and position
if #matches == 0 then