Skip to content

Commit d3809da

Browse files
committed
rename eq_zero -> is_zero
1 parent ff7014a commit d3809da

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/wasmi/src/engine/translator/func/instr_encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ impl InstrEncoder {
840840
lhs: Reg,
841841
rhs: T,
842842
) -> Result<bool, Error> {
843-
if !rhs.eq_zero() {
843+
if !rhs.is_zero() {
844844
// Case: `rhs` needs to be zero to apply this optimization.
845845
return Ok(false);
846846
}
@@ -885,7 +885,7 @@ impl InstrEncoder {
885885
lhs: Reg,
886886
rhs: T,
887887
) -> Result<bool, Error> {
888-
if !rhs.eq_zero() {
888+
if !rhs.is_zero() {
889889
// Case: `rhs` needs to be zero to apply this optimization.
890890
return Ok(false);
891891
}

crates/wasmi/src/engine/translator/func/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ impl FuncTranslator {
13281328
// Custom optimization was applied: return early
13291329
return Ok(());
13301330
}
1331-
if T::from(lhs).eq_zero() {
1331+
if T::from(lhs).is_zero() {
13321332
// Optimization: Shifting or rotating a zero value is a no-op.
13331333
self.stack.push_const(lhs);
13341334
return Ok(());

crates/wasmi/src/engine/translator/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub trait WasmInteger:
5858
fn non_zero(self) -> Option<Self::NonZero>;
5959

6060
/// Returns `true` if `self` is equal to zero (0).
61-
fn eq_zero(self) -> bool;
61+
fn is_zero(self) -> bool;
6262
}
6363

6464
macro_rules! impl_wasm_integer {
@@ -71,7 +71,7 @@ macro_rules! impl_wasm_integer {
7171
Self::NonZero::new(self)
7272
}
7373

74-
fn eq_zero(self) -> bool {
74+
fn is_zero(self) -> bool {
7575
self == 0
7676
}
7777
}

0 commit comments

Comments
 (0)