Skip to content

Commit

Permalink
Optimize presence update for self in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Hellyer committed Feb 1, 2017
1 parent d72f9cf commit 9392f61
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/client/gateway/shard.rs
Expand Up @@ -680,15 +680,10 @@ impl Shard {
{
let mut cache = CACHE.write().unwrap();
let current_user_id = cache.user.id;

for (user_id, presence) in &mut cache.presences {
if *user_id != current_user_id {
continue;
}

cache.presences.get_mut(&current_user_id).map(|presence| {
presence.game = game.clone();
presence.last_modified = Some(now);
}
});
}
}
}

0 comments on commit 9392f61

Please sign in to comment.