Skip to content

Commit

Permalink
fixed stupid bug that would cause range errors in the -I option when …
Browse files Browse the repository at this point in the history
…using a list of indices other than 0,1,2,3...
  • Loading branch information
Stephan Schiffels committed Sep 18, 2018
1 parent c0b5620 commit d184380
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions msmc2.d
Expand Up @@ -135,9 +135,9 @@ void parseCommandLine(string[] args) {
void handleIndices(string option, string value) {
try {
auto hapIndices = std.string.split(value, ",").map!"a.to!size_t()"().array();
foreach(i; hapIndices[0..$-1])
foreach(j; hapIndices[i..$])
pairIndices ~= [i, j];
foreach(i; 0..(hapIndices.length - 1))
foreach(j; (i + 1)..hapIndices.length)
pairIndices ~= [hapIndices[i], hapIndices[j]];
}
catch(ConvException e) {
auto pairIndexSubStrings = std.string.split(value, ",");
Expand Down

0 comments on commit d184380

Please sign in to comment.