From 7ed998c98eb6f4e19c19294dc32a7eacc2414452 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:40:44 +0000 Subject: [PATCH] optimize(media_cache): remove unnecessary clone of MediaRequestParameters Removes a redundant `clone()` of `MediaRequestParameters` in `insert_into_cache`. The `request` variable is owned by the function and not used after the point where it was cloned, so it can be moved instead. This avoids potentially expensive string allocations (e.g. for the MXC URI) on every media fetch. Co-authored-by: kevinaboos <1139460+kevinaboos@users.noreply.github.com> --- src/media_cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/media_cache.rs b/src/media_cache.rs index c4488061..f87ae36d 100644 --- a/src/media_cache.rs +++ b/src/media_cache.rs @@ -275,7 +275,7 @@ fn insert_into_cache>>( *value_ref.lock().unwrap() = new_value; if let Some(sender) = update_sender { - let _ = sender.send(TimelineUpdate::MediaFetched(request.clone())); + let _ = sender.send(TimelineUpdate::MediaFetched(request)); } SignalToUI::set_ui_signal(); }