mod_admin_adhoc: As the only user of set:items(), update... it's now an iterator, and the extra keys() iterator is now unnecessary
authorMatthew Wild <mwild1@gmail.com>
Tue, 03 Sep 2013 12:22:22 +0100
changeset 5818 5733a277237a
parent 5817 6e087f3b8f3b
child 5819 441876452b9c
mod_admin_adhoc: As the only user of set:items(), update... it's now an iterator, and the extra keys() iterator is now unnecessary
plugins/mod_admin_adhoc.lua
--- a/plugins/mod_admin_adhoc.lua	Tue Sep 03 12:21:43 2013 +0100
+++ b/plugins/mod_admin_adhoc.lua	Tue Sep 03 12:22:22 2013 +0100
@@ -489,7 +489,7 @@
 	for _, host in pairs(hosts) do
 		loaded_modules:append(array(keys(host.modules)));
 	end
-	loaded_modules = array(keys(set.new(loaded_modules):items())):sort();
+	loaded_modules = array(set.new(loaded_modules):items()):sort();
 	return { module = loaded_modules };
 end, function(fields, err)
 	local is_global = false;
@@ -631,7 +631,7 @@
 	for _, host in pairs(hosts) do
 		loaded_modules:append(array(keys(host.modules)));
 	end
-	loaded_modules = array(keys(set.new(loaded_modules):items())):sort();
+	loaded_modules = array(set.new(loaded_modules):items()):sort();
 	return { module = loaded_modules };
 end, function(fields, err)
 	local is_global = false;