Skip to content

Commit

Permalink
Refactor object evaluation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviRain-Su committed Oct 23, 2023
1 parent 7b9aeeb commit f023ff3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/evaluator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,20 +306,20 @@ impl Object {
match self {
Object::Boolean(value) => {
if value.value() {
(false).into()
false.into()
} else {
(true).into()
true.into()
}
}
Object::Integer(value) => {
if value.value() != 0 {
(false).into()
false.into()
} else {
(true).into()
true.into()
}
}
Object::Null(_) => (true).into(),
_ => (false).into(),
Object::Null(_) => true.into(),
_ => false.into(),
}
}

Expand Down

0 comments on commit f023ff3

Please sign in to comment.