Skip to content

Commit

Permalink
inline active
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmurariu committed Jun 18, 2024
1 parent cb450a6 commit 2ae5d80
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions raphtory/src/core/storage/timeindex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ impl<'a, T: AsTime, Ops: TimeIndexOps<IndexType = T>, V: AsRef<Vec<Ops>> + Send
= LayeredTimeIndexWindow<'b, Ops::RangeType<'b>> where
Self: 'b;

#[inline(always)]
fn active(&self, w: Range<Self::IndexType>) -> bool {
self.view.as_ref().iter().any(|t| t.active(w.clone()))
}
Expand Down Expand Up @@ -425,6 +426,7 @@ where
type IndexType = T;
type RangeType<'a> = TimeIndexWindow<'a, T> where Self: 'a;

#[inline(always)]
fn active(&self, w: Range<T>) -> bool {
match self {
TimeIndexWindow::Empty => false,
Expand Down Expand Up @@ -509,6 +511,7 @@ impl<'a, Ops: TimeIndexOps + 'a> TimeIndexOps for LayeredTimeIndexWindow<'a, Ops
type IndexType = Ops::IndexType;
type RangeType<'b> = LayeredTimeIndexWindow<'b, Ops::RangeType<'b>> where Self: 'b;

#[inline(always)]
fn active(&self, w: Range<Self::IndexType>) -> bool {
self.timeindex.iter().any(|t| t.active(w.clone()))
}
Expand Down
1 change: 1 addition & 0 deletions raphtory/src/db/api/storage/edges/edge_storage_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl<'a> TimeIndexOps for TimeIndexRef<'a> {
type IndexType = TimeIndexEntry;
type RangeType<'b> = TimeIndexRef<'b> where Self: 'b;

#[inline(always)]
fn active(&self, w: Range<TimeIndexEntry>) -> bool {
match self {
TimeIndexRef::Ref(t) => t.active(w),
Expand Down
1 change: 1 addition & 0 deletions raphtory/src/db/api/storage/nodes/node_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ macro_rules! for_all_iter {
}

impl<'a> NodeStorageEntry<'a> {
#[inline]
pub fn as_ref(&self) -> NodeStorageRef {
match self {
NodeStorageEntry::Mem(entry) => NodeStorageRef::Mem(entry),
Expand Down
1 change: 1 addition & 0 deletions raphtory/src/db/api/view/internal/core_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ impl<'b> TimeIndexOps for NodeAdditions<'b> {
type IndexType = i64;
type RangeType<'a> = NodeAdditions<'a> where Self: 'a;

#[inline]
fn active(&self, w: Range<i64>) -> bool {
match self {
NodeAdditions::Mem(index) => index.active_t(w),
Expand Down

0 comments on commit 2ae5d80

Please sign in to comment.