perf: refactor to reduce memory allocations and cpu work
This commit is contained in:
parent
0c3e3c8629
commit
dd0158d8f0
24 changed files with 234 additions and 242 deletions
|
|
@ -249,12 +249,7 @@ impl Ord for BluerDevice {
|
|||
impl PartialOrd for BluerDevice {
|
||||
#[inline]
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
match self.status.cmp(&other.status) {
|
||||
std::cmp::Ordering::Equal => {
|
||||
Some(self.name.to_lowercase().cmp(&other.name.to_lowercase()))
|
||||
}
|
||||
o => Some(o),
|
||||
}
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue