use boxed slices instead of vecs where possible

This commit is contained in:
Evan Almloff committed 2024-01-07 13:41:39 -06:00
1 parent c59926cb1f
commit aefa8a2431
9 files changed
+53 -46

No files matched your search

+13 -1
View File
@@ -2,12 +2,24 @@ use std::hash::Hash;
use crate::ScopeId;
#[derive(Debug, Clone, Eq, PartialOrd, Ord)]
#[derive(Debug, Clone, Eq)]
pub struct DirtyScope {
pub height: u32,
pub id: ScopeId,
}
impl PartialOrd for DirtyScope {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Ord for DirtyScope {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.height.cmp(&other.height).then(self.id.cmp(&other.id))
}
}
impl PartialEq for DirtyScope {
fn eq(&self, other: &Self) -> bool {
self.id == other.id