Skip to content

Commit

Permalink
less string clones in node lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
ljeub-pometry committed Jul 2, 2024
1 parent fd400bc commit 61c2e42
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pometry-storage-private
2 changes: 0 additions & 2 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(non_local_definitions)]

extern crate core;
use pyo3::prelude::*;
use raphtory_core::python::packages::base_modules::{
Expand Down
6 changes: 3 additions & 3 deletions raphtory/src/disk_graph/graph_impl/core_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::{
};
use itertools::Itertools;
use polars_arrow::datatypes::ArrowDataType;
use pometry_storage::{properties::ConstProps, GidRef, GID};
use pometry_storage::{properties::ConstProps, GidRef};
use raphtory_api::core::{input::input_node::InputNode, storage::arc_str::ArcStr};
use rayon::prelude::*;

Expand Down Expand Up @@ -121,8 +121,8 @@ impl CoreGraphOps for DiskGraph {
fn internalise_node(&self, v: NodeRef) -> Option<VID> {
match v {
NodeRef::Internal(vid) => Some(vid),
NodeRef::External(vid) => self.inner.find_node(&GID::U64(vid)),
NodeRef::ExternalStr(string) => self.inner.find_node(&GID::Str(string.into())),
NodeRef::External(vid) => self.inner.find_node(GidRef::U64(vid)),
NodeRef::ExternalStr(string) => self.inner.find_node(GidRef::Str(string)),
}
}

Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl NodeSource {
NodeSource::ExternalIds(ext_ids) => Box::new(
ext_ids
.into_iter()
.filter_map(move |gid| graph.inner.find_node(&gid)),
.filter_map(move |gid| graph.inner.find_node(gid.as_ref())),
),
}
}
Expand Down
2 changes: 0 additions & 2 deletions raphtory/src/python/graph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(non_local_definitions)]

pub mod algorithm_result;
#[cfg(feature = "storage")]
pub mod disk_graph;
Expand Down
1 change: 0 additions & 1 deletion raphtory/src/python/types/macros/trait_impl/node_state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(non_local_definitions)]
use crate::{
core::entities::nodes::node_ref::NodeRef,
db::{
Expand Down
1 change: 0 additions & 1 deletion raphtory/src/python/types/wrappers/document.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(non_local_definitions)]
use crate::core::{DocumentInput, Lifespan};
use itertools::Itertools;
use pyo3::{exceptions::PyAttributeError, prelude::*, types::PyTuple};
Expand Down

0 comments on commit 61c2e42

Please sign in to comment.