Software /
code /
prosody
Comparison
plugins/mod_admin_adhoc.lua @ 5818:5733a277237a
mod_admin_adhoc: As the only user of set:items(), update... it's now an iterator, and the extra keys() iterator is now unnecessary
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 03 Sep 2013 12:22:22 +0100 |
parent | 5721:579c51cbc12c |
child | 6457:ddcb29a35409 |
comparison
equal
deleted
inserted
replaced
5817:6e087f3b8f3b | 5818:5733a277237a |
---|---|
487 local globally_reload_module_handler = adhoc_initial(globally_reload_module_layout, function() | 487 local globally_reload_module_handler = adhoc_initial(globally_reload_module_layout, function() |
488 local loaded_modules = array(keys(modulemanager.get_modules("*"))); | 488 local loaded_modules = array(keys(modulemanager.get_modules("*"))); |
489 for _, host in pairs(hosts) do | 489 for _, host in pairs(hosts) do |
490 loaded_modules:append(array(keys(host.modules))); | 490 loaded_modules:append(array(keys(host.modules))); |
491 end | 491 end |
492 loaded_modules = array(keys(set.new(loaded_modules):items())):sort(); | 492 loaded_modules = array(set.new(loaded_modules):items()):sort(); |
493 return { module = loaded_modules }; | 493 return { module = loaded_modules }; |
494 end, function(fields, err) | 494 end, function(fields, err) |
495 local is_global = false; | 495 local is_global = false; |
496 | 496 |
497 if err then | 497 if err then |
629 local globally_unload_module_handler = adhoc_initial(globally_unload_module_layout, function() | 629 local globally_unload_module_handler = adhoc_initial(globally_unload_module_layout, function() |
630 local loaded_modules = array(keys(modulemanager.get_modules("*"))); | 630 local loaded_modules = array(keys(modulemanager.get_modules("*"))); |
631 for _, host in pairs(hosts) do | 631 for _, host in pairs(hosts) do |
632 loaded_modules:append(array(keys(host.modules))); | 632 loaded_modules:append(array(keys(host.modules))); |
633 end | 633 end |
634 loaded_modules = array(keys(set.new(loaded_modules):items())):sort(); | 634 loaded_modules = array(set.new(loaded_modules):items()):sort(); |
635 return { module = loaded_modules }; | 635 return { module = loaded_modules }; |
636 end, function(fields, err) | 636 end, function(fields, err) |
637 local is_global = false; | 637 local is_global = false; |
638 if err then | 638 if err then |
639 return generate_error_message(err); | 639 return generate_error_message(err); |