Skip to content

Commit

Permalink
Fix pop_bool
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Aug 1, 2023
1 parent e964ad6 commit a5013b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use dyn_clone::DynClone;
use everscale_types::cell::OwnedCellSlice;
use everscale_types::prelude::*;
use num_bigint::BigInt;
use num_traits::{One, Signed, ToPrimitive, Zero};
use num_traits::{One, ToPrimitive, Zero};

use super::cont::*;

Expand Down Expand Up @@ -89,8 +89,7 @@ impl Stack {
}

pub fn pop_bool(&mut self) -> Result<bool> {
let item = self.pop_int()?;
Ok(item.is_negative())
Ok(!self.pop_int()?.is_zero())
}

pub fn pop_smallint_range(&mut self, min: u32, max: u32) -> Result<u32> {
Expand Down

0 comments on commit a5013b2

Please sign in to comment.