Avoid unneeded return keywords.

This commit is contained in:
Dan Gohman
2017-08-30 12:40:44 -07:00
parent 3532c3533a
commit 01744d6f65
2 changed files with 9 additions and 10 deletions

View File

@@ -31,7 +31,7 @@ impl<T> BitSet<T>
pub fn contains(&self, num: u8) -> bool { pub fn contains(&self, num: u8) -> bool {
assert!((num as usize) < Self::bits()); assert!((num as usize) < Self::bits());
assert!((num as usize) < Self::max_bits()); assert!((num as usize) < Self::max_bits());
return self.0.into() & (1 << num) != 0; self.0.into() & (1 << num) != 0
} }
/// Return the smallest number contained in the bitset or None if empty /// Return the smallest number contained in the bitset or None if empty

View File

@@ -252,26 +252,25 @@ impl<Variable> SSABuilder<Variable>
UseVarCases::SealedOnePredecessor(pred) => { UseVarCases::SealedOnePredecessor(pred) => {
let (val, mids) = self.use_var(dfg, layout, jts, var, ty, pred); let (val, mids) = self.use_var(dfg, layout, jts, var, ty, pred);
self.def_var(var, val, block); self.def_var(var, val, block);
return (val, mids); (val, mids)
} }
// The block has multiple predecessors, we register the ebb argument as the current // The block has multiple predecessors, we register the ebb argument as the current
// definition for the variable. // definition for the variable.
UseVarCases::Unsealed(val) => { UseVarCases::Unsealed(val) => {
self.def_var(var, val, block); self.def_var(var, val, block);
return (val, (val,
SideEffects { SideEffects {
split_ebbs_created: Vec::new(), split_ebbs_created: Vec::new(),
instructions_added_to_ebbs: Vec::new(), instructions_added_to_ebbs: Vec::new(),
}); })
} }
UseVarCases::SealedMultiplePredecessors(preds, val, ebb) => { UseVarCases::SealedMultiplePredecessors(preds, val, ebb) => {
// If multiple predecessor we look up a use_var in each of them: // If multiple predecessor we look up a use_var in each of them:
// if they all yield the same value no need for an Ebb argument // if they all yield the same value no need for an Ebb argument
self.def_var(var, val, block); self.def_var(var, val, block);
return self.predecessors_lookup(dfg, layout, jts, val, var, ebb, &preds); self.predecessors_lookup(dfg, layout, jts, val, var, ebb, &preds)
} }
}; }
} }
/// Declares a new basic block belonging to the body of a certain `Ebb` and having `pred` /// Declares a new basic block belonging to the body of a certain `Ebb` and having `pred`