Skip to content

Commit

Permalink
fix rev compl bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Dec 7, 2018
1 parent 2dbff3a commit 36c7e1e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/fmindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,17 @@ namespace tracy
risize += c.trimLeft;
}
if (risize + c.trimRight < rs.refslice.size()) risize += c.trimRight;
int32_t oldlen = rs.refslice.size();
rs.refslice = rs.refslice.substr(ri, risize);
rs.pos += ri;
if (rs.forward) rs.pos += ri;
else {
int32_t offset = oldlen - (int32_t) ri - (int32_t) risize;
if (offset < 0) {
std::cerr << "Warning: Offset smaller than zero!" << std::endl;
} else {
rs.pos += offset;
}
}
}


Expand Down

0 comments on commit 36c7e1e

Please sign in to comment.