mirror of
https://github.com/openai/codex.git
synced 2026-09-16 12:13:30 +00:00
Merge f921c6e772 into sapling-pr-archive-bolinfest
This commit is contained in:
@@ -199,6 +199,14 @@ pub async fn run(
|
||||
})
|
||||
}
|
||||
|
||||
/// Sort matches in-place by descending score, then ascending path.
|
||||
fn sort_matches(matches: &mut [(u32, String)]) {
|
||||
matches.sort_by(|a, b| match b.0.cmp(&a.0) {
|
||||
std::cmp::Ordering::Equal => a.1.cmp(&b.1),
|
||||
other => other,
|
||||
});
|
||||
}
|
||||
|
||||
/// Maintains the `max_count` best matches for a given pattern.
|
||||
struct BestMatchesList {
|
||||
max_count: usize,
|
||||
|
||||
Reference in New Issue
Block a user