Skip to content

Commit bd43aef

Browse files
committed
🐛 Fix LRU cache borrow issue - use peek() instead of get()
1 parent ac96803 commit bd43aef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ui/sidebar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ fn render_file_browser(
431431
.unwrap_or(false);
432432

433433
let duration = if !entry.is_dir {
434-
if let Some(cached_duration) = app.duration_cache.get(&entry.path) {
434+
if let Some(cached_duration) = app.duration_cache.peek(&entry.path) {
435435
Some(*cached_duration)
436436
} else if !app.duration_extraction_in_progress.contains(&entry.path) {
437437
files_to_extract.push(entry.path.clone());
@@ -468,7 +468,7 @@ fn render_file_browser(
468468
for path in files_to_extract {
469469
app.duration_extraction_in_progress.insert(path.clone());
470470
let sender = app.duration_sender.clone();
471-
std::thread::spawn(move || {
471+
app.duration_thread_pool.execute(move || {
472472
let duration = crate::metadata::duration::extract_duration(&path);
473473
let _ = sender.send((path, duration));
474474
});

0 commit comments

Comments
 (0)