From e985fc23aec0a7769649850b42f4a5cafde075ac Mon Sep 17 00:00:00 2001 From: Zoran Cvetkov Date: Wed, 6 Nov 2024 18:07:41 +0200 Subject: [PATCH] cleanup --- graph/src/components/store/entity_cache.rs | 22 +++++++++++----------- graph/src/schema/input/mod.rs | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/graph/src/components/store/entity_cache.rs b/graph/src/components/store/entity_cache.rs index 24962b6d8b6..6ea8b988bb2 100644 --- a/graph/src/components/store/entity_cache.rs +++ b/graph/src/components/store/entity_cache.rs @@ -459,16 +459,16 @@ impl EntityCache { // Entity was created (None, EntityOp::Update(mut updates)) | (None, EntityOp::Overwrite(mut updates)) => { + let vid = updates.vid; updates.e.remove_null_fields(); - let data = Arc::new(updates); - self.current - .insert(key.clone(), Some(data.e.clone().into())); + let data = Arc::new(updates.e.clone()); + self.current.insert(key.clone(), Some(data.cheap_clone())); Some(Insert { key, - data: data.e.clone().into(), + data, block, end: None, - vid: data.vid, + vid, }) } // Entity may have been changed @@ -493,16 +493,16 @@ impl EntityCache { } // Entity was removed and then updated, so it will be overwritten (Some(current), EntityOp::Overwrite(data)) => { - let data = Arc::new(data); - self.current - .insert(key.clone(), Some(data.e.clone().into())); - if current != data.e.clone().into() { + let vid = data.vid; + let data = Arc::new(data.e.clone()); + self.current.insert(key.clone(), Some(data.cheap_clone())); + if current != data { Some(Overwrite { key, - data: data.e.clone().into(), + data, block, end: None, - vid: data.vid, + vid, }) } else { None diff --git a/graph/src/schema/input/mod.rs b/graph/src/schema/input/mod.rs index a71be5a500f..222b55bea3a 100644 --- a/graph/src/schema/input/mod.rs +++ b/graph/src/schema/input/mod.rs @@ -1489,9 +1489,9 @@ impl InputSchema { pub fn has_field_with_name(&self, entity_type: &EntityType, field: &str) -> bool { // TODO: check if it is needed - if field == VID { - return true; - } + // if field == VID { + // return true; + // } let field = self.inner.pool.lookup(field); match field {