Software /
code /
prosody
Comparison
util/filters.lua @ 3140:8c6ed6fd2d35
util.filters: Break processing if a filterer returns nil
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 02 Jun 2010 13:31:36 +0100 |
parent | 3139:7b4f180d7c6f |
child | 3142:3cf02e5e632b |
comparison
equal
deleted
inserted
replaced
3139:7b4f180d7c6f | 3140:8c6ed6fd2d35 |
---|---|
17 function session.filter(type, data) | 17 function session.filter(type, data) |
18 local filter_list = filters[type]; | 18 local filter_list = filters[type]; |
19 if filter_list then | 19 if filter_list then |
20 for i = 1, #filter_list do | 20 for i = 1, #filter_list do |
21 data = filter_list[i](data); | 21 data = filter_list[i](data); |
22 if data == nil then break; end | |
22 end | 23 end |
23 end | 24 end |
24 return data; | 25 return data; |
25 end | 26 end |
26 end | 27 end |