Skip to content

Commit 3ad8a77

Browse files
committed
Changed: Add #[inline] hints to probe helper functions
Annotate find_binary_on_path_in, classify_shell_candidate, and resolve_host_shell_in with #[inline] per the performance coding guidelines for small, potentially hot-path helpers.
1 parent 45d6308 commit 3ad8a77

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/llm-coding-tools-bubblewrap/src

src/llm-coding-tools-bubblewrap/src/probe.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ fn profile_name(preset: Option<Preset>) -> &'static str {
9292
}
9393
}
9494

95+
#[inline]
9596
fn find_binary_on_path_in(name: &str, path: Option<&OsStr>) -> Option<Box<Path>> {
9697
let path = path?;
9798
for dir in env::split_paths(path) {
@@ -149,6 +150,7 @@ where
149150
None
150151
}
151152

153+
#[inline]
152154
fn classify_shell_candidate<F, R>(
153155
classify: &mut F,
154156
seen: &mut HashSet<Box<Path>>,
@@ -164,6 +166,7 @@ where
164166
classify(path.as_ref()).map(|result| (path, result))
165167
}
166168

169+
#[inline]
167170
fn resolve_host_shell_in(path: Option<&OsStr>) -> Option<Box<Path>> {
168171
first_shell_candidate_with_in(path, &mut |_| Some(())).map(|(path, _)| path)
169172
}

0 commit comments

Comments
 (0)