1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-05 02:54:10 +02:00

compare definitions by index

This commit is contained in:
Robin Appelman 2019-08-29 16:32:15 +02:00
commit 06d53573d4
2 changed files with 5 additions and 4 deletions

View file

@ -49,7 +49,7 @@ pub struct SendPropDefinition {
impl PartialEq for SendPropDefinition {
fn eq(&self, other: &Self) -> bool {
self.owner_table == other.owner_table && self.name == other.name
self.index == other.index
}
}
@ -529,11 +529,12 @@ impl From<Vec<SendPropValue>> for SendPropValue {
}
#[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct SendPropDefinitionIndex(usize, usize);
pub struct SendPropDefinitionIndex(u32);
impl SendPropDefinitionIndex {
pub fn new(table: usize, prop: usize) -> Self {
SendPropDefinitionIndex(table, prop)
// there can be at most 1024 (10 bits) props per table
SendPropDefinitionIndex((table * 1024 + prop) as u32)
}
}