From 61c2e42ddf361ffc3dd81af6f569dc61e666c4fd Mon Sep 17 00:00:00 2001 From: Lucas Jeub Date: Tue, 11 Jun 2024 11:26:00 +0200 Subject: [PATCH] less string clones in node lookups --- pometry-storage-private | 2 +- python/src/lib.rs | 2 -- raphtory/src/disk_graph/graph_impl/core_ops.rs | 6 +++--- raphtory/src/disk_graph/query/mod.rs | 2 +- raphtory/src/python/graph/mod.rs | 2 -- raphtory/src/python/types/macros/trait_impl/node_state.rs | 1 - raphtory/src/python/types/wrappers/document.rs | 1 - 7 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pometry-storage-private b/pometry-storage-private index 45f16ded88..3f2ae8706f 160000 --- a/pometry-storage-private +++ b/pometry-storage-private @@ -1 +1 @@ -Subproject commit 45f16ded88a34586c75a6e45133220a84cf0bdd1 +Subproject commit 3f2ae8706f88f67bcb3eefa2878ead5a6b637406 diff --git a/python/src/lib.rs b/python/src/lib.rs index c2afad853d..00456219e5 100644 --- a/python/src/lib.rs +++ b/python/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(non_local_definitions)] - extern crate core; use pyo3::prelude::*; use raphtory_core::python::packages::base_modules::{ diff --git a/raphtory/src/disk_graph/graph_impl/core_ops.rs b/raphtory/src/disk_graph/graph_impl/core_ops.rs index 423f60d9ae..6655933b4e 100644 --- a/raphtory/src/disk_graph/graph_impl/core_ops.rs +++ b/raphtory/src/disk_graph/graph_impl/core_ops.rs @@ -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::*; @@ -121,8 +121,8 @@ impl CoreGraphOps for DiskGraph { fn internalise_node(&self, v: NodeRef) -> Option { 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)), } } diff --git a/raphtory/src/disk_graph/query/mod.rs b/raphtory/src/disk_graph/query/mod.rs index 2627ceb4f4..9402aaef51 100644 --- a/raphtory/src/disk_graph/query/mod.rs +++ b/raphtory/src/disk_graph/query/mod.rs @@ -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())), ), } } diff --git a/raphtory/src/python/graph/mod.rs b/raphtory/src/python/graph/mod.rs index e32a05c680..008b470860 100644 --- a/raphtory/src/python/graph/mod.rs +++ b/raphtory/src/python/graph/mod.rs @@ -1,5 +1,3 @@ -#![allow(non_local_definitions)] - pub mod algorithm_result; #[cfg(feature = "storage")] pub mod disk_graph; diff --git a/raphtory/src/python/types/macros/trait_impl/node_state.rs b/raphtory/src/python/types/macros/trait_impl/node_state.rs index 5eb24d328f..8d3e3e1783 100644 --- a/raphtory/src/python/types/macros/trait_impl/node_state.rs +++ b/raphtory/src/python/types/macros/trait_impl/node_state.rs @@ -1,4 +1,3 @@ -#![allow(non_local_definitions)] use crate::{ core::entities::nodes::node_ref::NodeRef, db::{ diff --git a/raphtory/src/python/types/wrappers/document.rs b/raphtory/src/python/types/wrappers/document.rs index 6049268894..53644e5f3c 100644 --- a/raphtory/src/python/types/wrappers/document.rs +++ b/raphtory/src/python/types/wrappers/document.rs @@ -1,4 +1,3 @@ -#![allow(non_local_definitions)] use crate::core::{DocumentInput, Lifespan}; use itertools::Itertools; use pyo3::{exceptions::PyAttributeError, prelude::*, types::PyTuple};