Skip to content

Commit

Permalink
remove uneccessary eval
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham8287 committed Jan 24, 2024
1 parent 6ef0824 commit ecde151
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core/src/subscription/module_subscription_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ impl ModuleSubscriptionActor {
queries.extend(qset);
}

let sub = match self.subscriptions.iter_mut().find(|s| s.read_arc().queries == queries) {
let sub = match self.subscriptions.iter_mut().find(|s| s.read().queries == queries) {
Some(sub) => {
sub.write_arc().add_subscriber(sender);
sub.write().add_subscriber(sender);
sub
}
None => {
Expand All @@ -151,7 +151,7 @@ impl ModuleSubscriptionActor {
}
};

let subscription = sub.read_arc();
let subscription = sub.read();
let database_update = subscription.queries.eval(&self.relational_db, tx, auth)?;

let sender = subscription.subscribers().last().unwrap();
Expand Down Expand Up @@ -184,7 +184,7 @@ impl ModuleSubscriptionActor {

fn remove_subscriber(&mut self, client_id: ClientActorId) {
self.subscriptions.retain_mut(|sub| {
let mut subscription = sub.write_arc();
let mut subscription = sub.write();
subscription.remove_subscriber(client_id);
!subscription.subscribers().is_empty()
})
Expand Down

0 comments on commit ecde151

Please sign in to comment.