Remove duplicate lookup in get_or_insert_inner (#273)
This commit is contained in:
@@ -158,7 +158,6 @@ impl Songbird {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_or_insert_inner(&self, guild_id: GuildId) -> Arc<Mutex<Call>> {
|
fn get_or_insert_inner(&self, guild_id: GuildId) -> Arc<Mutex<Call>> {
|
||||||
self.get(guild_id).unwrap_or_else(|| {
|
|
||||||
self.calls
|
self.calls
|
||||||
.entry(guild_id)
|
.entry(guild_id)
|
||||||
.or_insert_with(|| {
|
.or_insert_with(|| {
|
||||||
@@ -183,7 +182,6 @@ impl Songbird {
|
|||||||
Arc::new(Mutex::new(call))
|
Arc::new(Mutex::new(call))
|
||||||
})
|
})
|
||||||
.clone()
|
.clone()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates an iterator for all [`Call`]s currently managed.
|
/// Creates an iterator for all [`Call`]s currently managed.
|
||||||
|
|||||||
Reference in New Issue
Block a user