summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-02 09:30:06 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-02 09:30:06 +0000
commitd73581c3424176cd83e58e8e8fdceea528b172f7 (patch)
tree3c9044f6d37f05dc5436ce50cfc83098ef63fca1 /lib/rbot/plugins.rb
parentb0b47f17ec0bea2cacde2aada54fab6273985f34 (diff)
plugins.rb: minor #delegate() optimization
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r--lib/rbot/plugins.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index 061c6a73..e1cf9c9f 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -626,19 +626,17 @@ module Plugins
def delegate(method, *args)
# debug "Delegating #{method.inspect}"
ret = Array.new
- [core_modules, plugins].each { |pl|
- pl.each {|p|
- if(p.respond_to? method)
- begin
- # debug "#{p.botmodule_class} #{p.name} responds"
- ret.push p.send(method, *args)
- rescue Exception => err
- raise if err.kind_of?(SystemExit)
- error report_error("#{p.botmodule_class} #{p.name} #{method}() failed:", err)
- raise if err.kind_of?(BDB::Fatal)
- end
+ (core_modules + plugins).each { |p|
+ if(p.respond_to? method)
+ begin
+ # debug "#{p.botmodule_class} #{p.name} responds"
+ ret.push p.send(method, *args)
+ rescue Exception => err
+ raise if err.kind_of?(SystemExit)
+ error report_error("#{p.botmodule_class} #{p.name} #{method}() failed:", err)
+ raise if err.kind_of?(BDB::Fatal)
end
- }
+ end
}
return ret
# debug "Finished delegating #{method.inspect}"