chore(perf): replace some string replacement and comparison with characters for performance

This commit is contained in:
alex committed 2025-10-24 18:59:15 -07:00
1 parent 86fa00928e
commit 0b0b4dc19d
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -99,7 +99,7 @@ impl BlsEntry {
self.linux
.clone()
.or(self.efi.clone())
.map(|path| path.replace("/", "\\").trim_start_matches("\\").to_string())
.map(|path| path.replace('/', "\\").trim_start_matches('\\').to_string())
}
/// Fetches the path to an initrd to pass to the kernel, if any.
@@ -107,7 +107,7 @@ impl BlsEntry {
pub fn initrd_path(&self) -> Option<String> {
self.initrd
.clone()
.map(|path| path.replace("/", "\\").trim_start_matches("\\").to_string())
.map(|path| path.replace('/', "\\").trim_start_matches('\\').to_string())
}
/// Fetches the options to pass to the kernel, if any.