Commit 9c7a455e authored by Mikael Salson's avatar Mikael Salson

AffectAnalyser: Correction of bug characterized in f41ace6f

parent f41ace6f
......@@ -349,7 +349,7 @@ affect_infos KmerAffectAnalyser<T>::getMaximum(const T &before,
results.nb_before_left = results.nb_before_right = results.nb_after_right = results.nb_after_left = 0;
currentValue = 0;
for (int i = 0; i < span - maxOverlap; i++) {
for (int i = 0; i < min(length,span - maxOverlap); i++) {
if (affectations[i] == after) {
currentValue--;
results.nb_after_right++;
......@@ -388,7 +388,7 @@ affect_infos KmerAffectAnalyser<T>::getMaximum(const T &before,
results.nb_before_right = 0;
}
}
for (int i = length - span + maxOverlap; i < length; i++) {
for (int i = length - span + maxOverlap; i < length && i >= 0; i++) {
if (affectations[i] == before)
results.nb_before_right++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment