Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: memory efficient poa bug fix #552

Closed
wants to merge 8 commits into from
4 changes: 2 additions & 2 deletions src/alignment/poa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ impl Traceback {

fn set(&mut self, i: usize, j: usize, cell: TracebackCell) {
// set the matrix cell if in band range
if !(self.matrix[i].1 > j || self.matrix[i].2 < j) {
if !(self.matrix[i].1 >= j || self.matrix[i].2 < j) {
let real_position = j - self.matrix[i].1;
self.matrix[i].0[real_position] = cell;
}
}

fn get(&self, i: usize, j: usize) -> &TracebackCell {
// get the matrix cell if in band range else return the appropriate values
if !(self.matrix[i].1 > j || self.matrix[i].2 < j) {
if !(self.matrix[i].1 >= j || self.matrix[i].2 < j) {
let real_position = j - self.matrix[i].1;
return &self.matrix[i].0[real_position];
}
Expand Down