Don't unnecessarily take &self for some ModuleDeclarations methods

This commit is contained in:
bjorn3
2020-11-09 14:53:15 +01:00
parent 79f6f72e78
commit 844a52e96a
3 changed files with 34 additions and 30 deletions

View File

@@ -167,8 +167,8 @@ impl SimpleJITModule {
fn get_definition(&self, name: &ir::ExternalName) -> *const u8 {
match *name {
ir::ExternalName::User { .. } => {
let (name, linkage) = if self.declarations.is_function(name) {
let func_id = self.declarations.get_function_id(name);
let (name, linkage) = if ModuleDeclarations::is_function(name) {
let func_id = FuncId::from_name(name);
match &self.functions[func_id] {
Some(compiled) => return compiled.ptr,
None => {
@@ -177,7 +177,7 @@ impl SimpleJITModule {
}
}
} else {
let data_id = self.declarations.get_data_id(name);
let data_id = DataId::from_name(name);
match &self.data_objects[data_id] {
Some(compiled) => return compiled.ptr,
None => {