mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-18 08:38:21 +02:00
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:
parent
0a414ecdf5
commit
548d919bd3
1 changed files with 4 additions and 10 deletions
|
|
@ -5488,22 +5488,16 @@ impl BasicBlock {
|
|||
}
|
||||
|
||||
pub fn phi_dsts(&self) -> Option<&OpPhiDsts> {
|
||||
for instr in self.instrs.iter() {
|
||||
match &instr.op {
|
||||
Op::PhiDsts(phi) => return Some(phi),
|
||||
_ => break,
|
||||
}
|
||||
if let Op::PhiDsts(phi) = &self.instrs.first()?.op {
|
||||
return Some(phi);
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn phi_dsts_mut(&mut self) -> Option<&mut OpPhiDsts> {
|
||||
for instr in self.instrs.iter_mut() {
|
||||
match &mut instr.op {
|
||||
Op::PhiDsts(phi) => return Some(phi),
|
||||
_ => break,
|
||||
}
|
||||
if let Op::PhiDsts(phi) = &mut self.instrs.first_mut()?.op {
|
||||
return Some(phi);
|
||||
}
|
||||
None
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue