Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/search.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// Returns the smallest index on [l, r) satisfying the condition.
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation refers to parameters 'l' and 'r', but the function signature uses 'range'. Update the doc comment to use 'range' instead of '[l, r)' for consistency with the actual parameter name.

Copilot uses AI. Check for mistakes.
pub fn lower_bound(range: std::ops::Range<usize>, prop: &dyn Fn(usize) -> bool) -> Option<usize> {
if prop(range.start) {
return Some(range.start);
Expand Down Expand Up @@ -36,6 +37,7 @@ mod test_lower_bound {
}
}

/// Returns the largest index on [l, r) satisfying the condition.
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation refers to parameters 'l' and 'r', but the function signature uses 'range'. Update the doc comment to use 'range' instead of '[l, r)' for consistency with the actual parameter name.

Suggested change
/// Returns the largest index on [l, r) satisfying the condition.
/// Returns the largest index in the range [range.start, range.end) satisfying the condition.

Copilot uses AI. Check for mistakes.
pub fn upper_bound(range: std::ops::Range<usize>, prop: &dyn Fn(usize) -> bool) -> Option<usize> {
if !prop(range.start) {
return None;
Expand Down