hideStart = region[0];
hideEnd = region[1];
// edit hidden regions to selection range
- if (hideStart < last)
+
+ // just move on if hideEnd is before last
+ if (hideEnd < last)
{
- if (hideEnd > last)
- {
- hideStart = last;
- }
- else
- {
- continue;
- }
+ continue;
}
-
+ // exit if next region is after end
if (hideStart > end)
{
break;
}
- if (hideEnd > end)
+ // truncate region at start if last falls in region
+ if ((hideStart < last) && (hideEnd >= last))
{
- hideEnd = end;
+ hideStart = last;
}
- if (hideStart > hideEnd)
+ // truncate region at end if end falls in region
+ if (hideEnd > end) // already checked that hideStart<=end
{
- break;
+ hideEnd = end;
}
+
/**
* form operations...
*/
last = hideEnd + 1;
}
// Final match if necessary.
- if (last < end)
+ if (last <= end)
{
addOperation(CigarArray.M, end - last + 1);
}