Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Nov 6, 2024
1 parent d15cea1 commit e985fc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions graph/src/components/store/entity_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions graph/src/schema/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e985fc2

Please sign in to comment.