perf: optimize torrent store with HashMap for O(1) updates
All checks were successful
Build MIPS Binary / build (push) Successful in 4m57s
All checks were successful
Build MIPS Binary / build (push) Successful in 4m57s
This commit is contained in:
@@ -82,9 +82,10 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
let sort_dir = create_rw_signal(SortDirection::Descending);
|
||||
|
||||
let filtered_torrents = move || {
|
||||
let mut torrents = store
|
||||
.torrents
|
||||
.get()
|
||||
// Convert HashMap values to Vec for filtering and sorting
|
||||
let torrents: Vec<shared::Torrent> = store.torrents.with(|map| map.values().cloned().collect());
|
||||
|
||||
let mut torrents = torrents
|
||||
.into_iter()
|
||||
.filter(|t| {
|
||||
let filter = store.filter.get();
|
||||
|
||||
Reference in New Issue
Block a user