mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'lemu/src/instructions/cop.rs')
| -rw-r--r-- | lemu/src/instructions/cop.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lemu/src/instructions/cop.rs b/lemu/src/instructions/cop.rs index 9e32720..250a0f1 100644 --- a/lemu/src/instructions/cop.rs +++ b/lemu/src/instructions/cop.rs @@ -12,16 +12,16 @@ super::op_enum! { pub enum ConditionOp { macro_rules! op { ($name: ident $op:tt ) => { - fn $name<'v>(a: LVar<'v>, b: LVar<'v>) -> bool { - if let LVar::Num(a) = a && let LVar::Num(b) = b { a $op b } else { false } + fn $name<'v>(a: &LVar<'v>, b: &LVar<'v>) -> bool { + if let &LVar::Num(a) = a && let &LVar::Num(b) = b { a $op b } else { false } } }; } -fn eq<'v>(a: LVar<'v>, b: LVar<'v>) -> bool { +fn eq<'v>(a: &LVar<'v>, b: &LVar<'v>) -> bool { a == b } -fn ne<'v>(a: LVar<'v>, b: LVar<'v>) -> bool { +fn ne<'v>(a: &LVar<'v>, b: &LVar<'v>) -> bool { a != b } op!(lt <); @@ -30,7 +30,7 @@ op!(le <=); op!(ge >=); impl ConditionOp { - pub const fn get_fn(self) -> for<'f> fn(LVar<'f>, LVar<'f>) -> bool { + pub const fn get_fn(self) -> for<'f> fn(&LVar<'f>, &LVar<'f>) -> bool { match self { Self::Equal | Self::StrictEqual => eq, Self::NotEqual => ne, |