mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 16:00:08 +01:00
nak: use filter() instead of open-coding it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
This commit is contained in:
parent
314144ba51
commit
28ff39fbb4
1 changed files with 2 additions and 18 deletions
|
|
@ -8918,15 +8918,7 @@ impl BasicBlock {
|
|||
}
|
||||
|
||||
pub fn branch(&self) -> Option<&Instr> {
|
||||
if let Some(i) = self.instrs.last() {
|
||||
if i.is_branch() {
|
||||
Some(i)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.instrs.last().filter(|&i| i.is_branch())
|
||||
}
|
||||
|
||||
pub fn branch_ip(&self) -> Option<usize> {
|
||||
|
|
@ -8943,15 +8935,7 @@ impl BasicBlock {
|
|||
|
||||
#[allow(dead_code)]
|
||||
pub fn branch_mut(&mut self) -> Option<&mut Instr> {
|
||||
if let Some(i) = self.instrs.last_mut() {
|
||||
if i.is_branch() {
|
||||
Some(i)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.instrs.last_mut().filter(|i| i.is_branch())
|
||||
}
|
||||
|
||||
pub fn falls_through(&self) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue