Software /
code /
prosody
Changeset
7351:11434c46b7b7
util.iterators: Normalize indentation
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 13 Apr 2016 20:00:41 +0200 |
parents | 7349:ad3dce172b01 |
children | 7354:8ca7f1c2c660 |
files | util/iterators.lua |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/util/iterators.lua Sat Apr 09 19:21:05 2016 +0100 +++ b/util/iterators.lua Wed Apr 13 20:00:41 2016 +0200 @@ -23,18 +23,18 @@ while true do local ret = { f(s, var) }; var = ret[1]; - if var == nil then break; end + if var == nil then break; end t_insert(results, 1, ret); end -- Then return our reverse one local i,max = 0, #results; return function (_results) - if i<max then - i = i + 1; - return unpack(_results[i]); - end - end, results; + if i<max then + i = i + 1; + return unpack(_results[i]); + end + end, results; end -- Iterate only over keys in a table @@ -62,8 +62,8 @@ while true do local ret = pack(f(s, var)); var = ret[1]; - if var == nil then break; end - if not set[var] then + if var == nil then break; end + if not set[var] then set[var] = true; return unpack(ret, 1, ret.n); end @@ -77,7 +77,7 @@ while true do var = f(s, var); - if var == nil then break; end + if var == nil then break; end x = x + 1; end @@ -110,7 +110,7 @@ while true do local ret = pack(f(s, var)); var = ret[1]; - if var == nil then break; end + if var == nil then break; end results[(count%n)+1] = ret; count = count + 1; end @@ -157,7 +157,7 @@ local t = {}; while true do var = f(s, var); - if var == nil then break; end + if var == nil then break; end t_insert(t, var); end return t; @@ -169,7 +169,7 @@ local t, var2 = {}; while true do var, var2 = f(s, var); - if var == nil then break; end + if var == nil then break; end t[var] = var2; end return t;