Reduce call to Module::is_empty.
This commit is contained in:
@@ -1445,7 +1445,7 @@ impl Engine {
|
||||
|
||||
// If new functions are defined within the eval string, it is an error
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
if !ast.shared_lib().is_empty() {
|
||||
if ast.has_functions() {
|
||||
return Err(crate::PERR::WrongFnDefinition.into());
|
||||
}
|
||||
|
||||
|
@@ -118,9 +118,7 @@ impl Engine {
|
||||
.cloned()
|
||||
.for_each(|(n, m)| global.push_import(n, m));
|
||||
|
||||
if !lib.is_empty() {
|
||||
global.lib.push(lib.clone());
|
||||
}
|
||||
global.lib.push(lib.clone());
|
||||
|
||||
Some(mem::replace(&mut global.constants, constants.clone()))
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user