pub(crate) fn group_range(
    base: CombinedGroupInfo,
    include: CombinedGroupInfo,
    exclude: CombinedGroupInfo,
) -> Option<Range<usize>> {
    let family = common_family(base.family, include.family, exclude.family)?;

    let max_offset = base
        .max_offset
        .max(include.max_offset)
        .max(exclude.max_offset);

    let query_mask = QueryMask::new(
        base.storage_mask | include.storage_mask,
        exclude.storage_mask,
    );

    let group = unsafe { &*family.as_ptr().add(max_offset) };

    if query_mask == group.include_mask() {
        Some(0..group.len())
    } else if query_mask == group.exclude_mask() {
        let prev_group = unsafe { &*family.as_ptr().add(max_offset - 1) };
        Some(group.len()..prev_group.len())
    } else {
        None
    }
}
/// Returns the range of elements the storages have in common if the
/// `CombinedGroupInfo`s form a group.
Returns the range of elements the storages have in common if the
`CombinedGroupInfo`s form a group.
Returns the range of elements the storages have in common if the ` CombinedGroupInfo ` s form a group .
pub(crate) fn group_range(
    base: CombinedGroupInfo,
    include: CombinedGroupInfo,
    exclude: CombinedGroupInfo,
) -> Option<Range<usize>> {
    let family = common_family(base.family, include.family, exclude.family)?;
    let max_offset = base
        .max_offset
        .max(include.max_offset)
        .max(exclude.max_offset);
    let query_mask = QueryMask::new(
        base.storage_mask | include.storage_mask,
        exclude.storage_mask,
    );
    let group = unsafe { &*family.as_ptr().add(max_offset) };
    if query_mask == group.include_mask() {
        Some(0..group.len())
    } else if query_mask == group.exclude_mask() {
        let prev_group = unsafe { &*family.as_ptr().add(max_offset - 1) };
        Some(group.len()..prev_group.len())
    } else {
        None
    }
}
pub ( crate ) fn group_range ( base : CombinedGroupInfo , include : CombinedGroupInfo , exclude : CombinedGroupInfo , ) -> Option < Range < usize > > { let family = common_family ( base . family , include . family , exclude . family ) ? ; let max_offset = base . max_offset . max ( include . max_offset ) . max ( exclude . max_offset ) ; let query_mask = QueryMask :: new ( base . storage_mask | include . storage_mask , exclude . storage_mask , ) ; let group = unsafe { & * family . as_ptr ( ) . add ( max_offset ) } ; if query_mask == group . include_mask ( ) { Some ( 0 .. group . len ( ) ) } else if query_mask == group . exclude_mask ( ) { let prev_group = unsafe { & * family . as_ptr ( ) . add ( max_offset - 1 ) } ; Some ( group . len ( ) .. prev_group . len ( ) ) } else { None } }
Returns the range of elements the storages have in common if the
`CombinedGroupInfo`s form a group.
Returns the range of elements the storages have in common if the ` CombinedGroupInfo ` s form a group .
base
CombinedGroupInfo
include
CombinedGroupInfo
exclude
CombinedGroupInfo
base
CombinedGroupInfo
include
CombinedGroupInfo
exclude
CombinedGroupInfo