From d184380bc0cf49fe534b94d0a657e29c9931b557 Mon Sep 17 00:00:00 2001 From: Stephan Schiffels Date: Tue, 18 Sep 2018 17:25:10 +0200 Subject: [PATCH] fixed stupid bug that would cause range errors in the -I option when using a list of indices other than 0,1,2,3... --- msmc2.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msmc2.d b/msmc2.d index ae58aee..73f2d5b 100644 --- a/msmc2.d +++ b/msmc2.d @@ -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, ",");