Skip to content

Commit

Permalink
Simplify some if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
abrown committed Sep 3, 2024
1 parent e391095 commit 87e1958
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions crates/wasm-smith/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,8 @@ impl Module {

fn arbitrary_composite_type(&mut self, u: &mut Unstructured) -> Result<CompositeType> {
use CompositeInnerType as CT;
let shared = if self.config.shared_everything_threads_enabled {
u.arbitrary()?
} else {
false
};
let shared = self.config.shared_everything_threads_enabled && u.arbitrary()?;

if !self.config.gc_enabled {
return Ok(CompositeType {
shared,
Expand Down Expand Up @@ -1301,11 +1298,7 @@ impl Module {
.collect(),
});
index_store.replace(new_index as u32);
let shared = if self.config.shared_everything_threads_enabled {
u.arbitrary().unwrap()
} else {
false
};
let shared = self.config.shared_everything_threads_enabled && u.arbitrary()?;
new_types.push(SubType {
is_final: true,
supertype: None,
Expand Down

0 comments on commit 87e1958

Please sign in to comment.