fix unnecessary copy every frame

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-10-15 11:45:13 -04:00
parent e5ba897ce6
commit 0a077ae797
4 changed files with 9 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ pub fn render_nav(col: usize, app: &mut Damus, ui: &mut egui::Ui) {
}
Route::Profile(pubkey) => render_profile_route(
*pubkey,
pubkey,
&app.ndb,
&mut app.columns,
&mut app.profiles,

View File

@@ -157,7 +157,7 @@ pub fn render_timeline_route(
#[allow(clippy::too_many_arguments)]
pub fn render_profile_route(
pubkey: Pubkey,
pubkey: &Pubkey,
ndb: &Ndb,
columns: &mut Columns,
profiles: &mut NotesHolderStorage<Profile>,

View File

@@ -15,7 +15,7 @@ use crate::{
use super::timeline::{tabs_ui, TimelineTabView};
pub struct ProfileView<'a> {
pubkey: Pubkey,
pubkey: &'a Pubkey,
col_id: usize,
profiles: &'a mut NotesHolderStorage<Profile>,
ndb: &'a Ndb,
@@ -25,7 +25,7 @@ pub struct ProfileView<'a> {
impl<'a> ProfileView<'a> {
pub fn new(
pubkey: Pubkey,
pubkey: &'a Pubkey,
col_id: usize,
profiles: &'a mut NotesHolderStorage<Profile>,
ndb: &'a Ndb,

View File

@@ -1,6 +1,9 @@
use crate::{
actionbar::TimelineResponse, imgcache::ImageCache, notecache::NoteCache,
notes_holder::{NotesHolder, NotesHolderStorage}, thread::Thread,
actionbar::TimelineResponse,
imgcache::ImageCache,
notecache::NoteCache,
notes_holder::{NotesHolder, NotesHolderStorage},
thread::Thread,
};
use nostrdb::{Ndb, NoteKey, Transaction};
use tracing::error;