nak: simplify phi_dsts
clippy complained that nothing was actually looping here. Luckily we can simplify the code. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27216>
This commit is contained in:
@@ -5488,22 +5488,16 @@ impl BasicBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn phi_dsts(&self) -> Option<&OpPhiDsts> {
|
pub fn phi_dsts(&self) -> Option<&OpPhiDsts> {
|
||||||
for instr in self.instrs.iter() {
|
if let Op::PhiDsts(phi) = &self.instrs.first()?.op {
|
||||||
match &instr.op {
|
return Some(phi);
|
||||||
Op::PhiDsts(phi) => return Some(phi),
|
|
||||||
_ => break,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn phi_dsts_mut(&mut self) -> Option<&mut OpPhiDsts> {
|
pub fn phi_dsts_mut(&mut self) -> Option<&mut OpPhiDsts> {
|
||||||
for instr in self.instrs.iter_mut() {
|
if let Op::PhiDsts(phi) = &mut self.instrs.first_mut()?.op {
|
||||||
match &mut instr.op {
|
return Some(phi);
|
||||||
Op::PhiDsts(phi) => return Some(phi),
|
|
||||||
_ => break,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user