Only recalculate sometimes

Recalculations are time consuming, so only do it if necessary.
This commit is contained in:
Spencer McIntyre 2022-03-21 16:19:37 -04:00
parent ff7b017e14
commit df04435d49
1 changed files with 3 additions and 3 deletions

View File

@ -41,9 +41,9 @@ class Msf::ModuleSet < Hash
# If there is no module associated with this class, then try to demand
# load it.
if klass.nil? or klass == Msf::SymbolicModule
framework.modules.load_cached_module(module_type, reference_name)
recalculate
if framework.modules.load_cached_module(module_type, reference_name) || empty?
recalculate
end
klass = fetch(reference_name, nil)
end