Skip to content

Commit 3a57262

Browse files
committed
return inside a block returns from outer method
So no need to check its return value.
1 parent ce60a1e commit 3a57262

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/msf/core/module_set.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ def on_module_reload(mod)
169169
end
170170

171171
# @!attribute [rw] postpone_recalc
172-
# Whether or not recalculations should be postponed. This is used from the context of the each_module_list
173-
# handler in order to prevent the demand # loader from calling recalc for each module if it's possible that more
174-
# than one module may be loaded. This field is not initialized until used.
172+
# Whether or not recalculations should be postponed. This is used
173+
# from the context of the {#each_module_list} handler in order to
174+
# prevent the demand loader from calling recalc for each module if
175+
# it's possible that more than one module may be loaded. This field
176+
# is not initialized until used.
175177
#
176-
# @return [true] if recalculate should not be called immediately
177-
# @return [false] if recalculate should be called immediately
178+
# @return [true] if {#recalculate} should not be called immediately
179+
# @return [false] if {#recalculate} should be called immediately
178180
attr_accessor :postpone_recalculate
179181

180182
# Dummy placeholder to recalculate aliases and other fun things.

lib/msf/core/modules/loader/base.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def load_module(parent_path, type, module_reference_name, options={})
125125
return false
126126
end
127127

128-
loaded = namespace_module_transaction(type + "/" + module_reference_name, :reload => reload) { |namespace_module|
128+
namespace_module_transaction(type + "/" + module_reference_name, :reload => reload) { |namespace_module|
129129
# set the parent_path so that the module can be reloaded with #load_module
130130
namespace_module.parent_path = parent_path
131131

@@ -180,10 +180,6 @@ def load_module(parent_path, type, module_reference_name, options={})
180180
true
181181
}
182182

183-
unless loaded
184-
return false
185-
end
186-
187183
if reload
188184
# Delete the original copy of the module so that module_manager.on_load_module called from inside load_module does
189185
# not trigger an ambiguous name warning, which would cause the reloaded module to not be stored in the

0 commit comments

Comments
 (0)