make equality less strange
This commit is contained in:
parent
78ec4e066f
commit
6a4566c223
1 changed files with 5 additions and 5 deletions
|
@ -1083,11 +1083,11 @@ impl Object {
|
||||||
pub fn is_truthy(&self) -> bool {
|
pub fn is_truthy(&self) -> bool {
|
||||||
match &self.native {
|
match &self.native {
|
||||||
Value::Null => self.kind.lock_ro().id != 0,
|
Value::Null => self.kind.lock_ro().id != 0,
|
||||||
Value::Int(x) => x > &0,
|
Value::Int(x) => *x > 0,
|
||||||
Value::Long(x) => x > &0,
|
Value::Long(x) => *x > 0,
|
||||||
Value::Mega(x) => x > &0,
|
Value::Mega(x) => *x > 0,
|
||||||
Value::Float(_) => true,
|
Value::Float(x) => x.is_finite(),
|
||||||
Value::Double(_) => true,
|
Value::Double(x) => x.is_finite(),
|
||||||
Value::Func(_) => true,
|
Value::Func(_) => true,
|
||||||
Value::Array(_) => true,
|
Value::Array(_) => true,
|
||||||
Value::Str(x) => !x.is_empty(),
|
Value::Str(x) => !x.is_empty(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue