use core::cmp::Ordering;
#[derive(Clone, Copy, Debug)]
#[repr(C)]
pub(crate) struct RawNtString<T> {
pub(crate) length: u16,
pub(crate) maximum_length: u16,
pub(crate) buffer: T,
}
pub(crate) fn cmp_iter<TI, OI>(mut this_iter: TI, mut other_iter: OI) -> Ordering
where
TI: Iterator<Item = u16>,
OI: Iterator<Item = u16>,
{
loop {
match (this_iter.next(), other_iter.next()) {
(Some(this_word), Some(other_word)) => {
if this_word != other_word {
return this_word.cmp(&other_word);
}
}
(Some(_), None) => {
return Ordering::Greater;
}
(None, Some(_)) => {
return Ordering::Less;
}
(None, None) => {
return Ordering::Equal;
}
}
}
}