Refactor.

This commit is contained in:
Stephen Chung
2022-10-10 16:46:35 +08:00
parent 796206f293
commit d6b0f99781
15 changed files with 161 additions and 166 deletions

View File

@@ -1742,10 +1742,9 @@ impl Module {
}
if let Some(ref variables) = other.variables {
if let Some(ref mut m) = self.variables {
m.extend(variables.iter().map(|(k, v)| (k.clone(), v.clone())));
} else {
self.variables = other.variables.clone();
match self.variables {
Some(ref mut m) => m.extend(variables.iter().map(|(k, v)| (k.clone(), v.clone()))),
None => self.variables = other.variables.clone(),
}
}
@@ -1767,10 +1766,9 @@ impl Module {
self.dynamic_functions_filter += &other.dynamic_functions_filter;
if let Some(ref type_iterators) = other.type_iterators {
if let Some(ref mut t) = self.type_iterators {
t.extend(type_iterators.iter().map(|(&k, v)| (k, v.clone())));
} else {
self.type_iterators = other.type_iterators.clone();
match self.type_iterators {
Some(ref mut t) => t.extend(type_iterators.iter().map(|(&k, v)| (k, v.clone()))),
None => self.type_iterators = other.type_iterators.clone(),
}
}
self.all_functions = None;