INNER CODE UNIT · Rust
get_windows
google/best · src/intervals.rs:77
pub fn get_windows(
start: usize,
end: usize,
win_len: usize,
pos: bool,
strand_rev: bool,
) -> Vec<FeatureInterval> {
let mut res = Vec::new();
for i in (start..end).step_by(win_len) {
let lo;
let hi;
if strand_rev {
hi = end - (i - start);
lo = hi.saturating_sub(win_len).max(start);
} else {
lo = i;
hi = (i + win_len).min(end);