Skip to content

Commit

Permalink
Remove allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Nov 17, 2024
1 parent c3bd034 commit 305fdc5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/loader/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ pub fn load_plugins() -> Result<()> {
continue;
};

let path = entry.path();
let mut path = entry.path();
// lowercase the path for comparisons
path.as_mut_os_str().make_ascii_lowercase();

// not a file or dll
if !path.is_file()
|| path
.extension()
.is_none_or(|e| e.to_ascii_lowercase() != "dll")
{
if !path.is_file() || path.extension().unwrap_or_default() != "dll" {
continue;
}

Expand Down

0 comments on commit 305fdc5

Please sign in to comment.