From 0566c3fa671061a5986160d4a2bc79391cd2f750 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 14 Jan 2024 15:38:20 +0100 Subject: [PATCH] Skip expensive merge for artist additon --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d1486e8..46eb026 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -812,8 +812,8 @@ impl MusicHoard { let artist_id: ArtistId = artist_id.into(); if self.get_artist(&artist_id).is_none() { - let new_artist = vec![Artist::new(artist_id)]; - self.merge_with_secondary(new_artist); + self.collection.push(Artist::new(artist_id)); + Self::sort_artists(&mut self.collection); } }