@@ -10447,13 +10447,13 @@ if (isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
1044710447 import std.traits : EnumMembers, isArray;
1044810448 import std.typecons : Rebindable;
1044910449
10450- void stripAndCheckLen(R valueBefore , size_t minLen, size_t line = __LINE__)
10450+ void stripAndCheckLen(size_t start , size_t minLen, size_t line = __LINE__)
1045110451 {
10452- value = _stripCFWS(valueBefore );
10452+ value = _stripCFWS(value[start .. value.length] );
1045310453 if (value.length < minLen)
1045410454 throw new DateTimeException("date-time value too short", __FILE__, line);
1045510455 }
10456- stripAndCheckLen(value , "7Dec1200:00A".length);
10456+ stripAndCheckLen(0 , "7Dec1200:00A".length);
1045710457
1045810458 static if (isArray!R && (is(ElementEncodingType!R == char) || is(ElementEncodingType!R == ubyte)))
1045910459 {
@@ -10488,18 +10488,18 @@ if (isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
1048810488 }
1048910489 default: throw new DateTimeException(format("Invalid day-of-week: %s", dowStr));
1049010490 }
10491- afterDoW: stripAndCheckLen(value[3 .. value.length] , ",7Dec1200:00A".length);
10491+ afterDoW: stripAndCheckLen(3 , ",7Dec1200:00A".length);
1049210492 if (value[0] != ',')
1049310493 throw new DateTimeException("day-of-week missing comma");
10494- stripAndCheckLen(value[1 .. value.length] , "7Dec1200:00A".length);
10494+ stripAndCheckLen(1 , "7Dec1200:00A".length);
1049510495 }
1049610496
1049710497 // day
1049810498 immutable digits = isDigit(value[1]) ? 2 : 1;
1049910499 immutable day = _convDigits!short(value[0 .. digits]);
1050010500 if (day == -1)
1050110501 throw new DateTimeException("Invalid day");
10502- stripAndCheckLen(value[ digits .. value.length] , "Dec1200:00A".length);
10502+ stripAndCheckLen(digits, "Dec1200:00A".length);
1050310503
1050410504 // month
1050510505 Month month;
@@ -10518,7 +10518,7 @@ afterDoW: stripAndCheckLen(value[3 .. value.length], ",7Dec1200:00A".length);
1051810518 }
1051910519 default: throw new DateTimeException(format("Invalid month: %s", monStr));
1052010520 }
10521- afterMon: stripAndCheckLen(value[3 .. value.length] , "1200:00A".length);
10521+ afterMon: stripAndCheckLen(3 , "1200:00A".length);
1052210522 }
1052310523
1052410524 // year
@@ -10545,29 +10545,29 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
1054510545 else
1054610546 throw new DateTimeException("Invalid year. Cannot be earlier than 1900.");
1054710547 }
10548- stripAndCheckLen(value[ yearLen .. value.length] , "00:00A".length);
10548+ stripAndCheckLen(yearLen, "00:00A".length);
1054910549
1055010550 // hour
1055110551 immutable hour = _convDigits!short(value[0 .. 2]);
10552- stripAndCheckLen(value[2 .. value.length] , ":00A".length);
10552+ stripAndCheckLen(2 , ":00A".length);
1055310553 if (value[0] != ':')
1055410554 throw new DateTimeException("Invalid hour");
10555- stripAndCheckLen(value[1 .. value.length] , "00A".length);
10555+ stripAndCheckLen(1 , "00A".length);
1055610556
1055710557 // minute
1055810558 immutable minute = _convDigits!short(value[0 .. 2]);
10559- stripAndCheckLen(value[2 .. value.length] , "A".length);
10559+ stripAndCheckLen(2 , "A".length);
1056010560
1056110561 // second
1056210562 short second;
1056310563 if (value[0] == ':')
1056410564 {
10565- stripAndCheckLen(value[1 .. value.length] , "00A".length);
10565+ stripAndCheckLen(1 , "00A".length);
1056610566 second = _convDigits!short(value[0 .. 2]);
1056710567 // this is just if/until SysTime is sorted out to fully support leap seconds
1056810568 if (second == 60)
1056910569 second = 59;
10570- stripAndCheckLen(value[2 .. value.length] , "A".length);
10570+ stripAndCheckLen(2 , "A".length);
1057110571 }
1057210572
1057310573 immutable(TimeZone) parseTZ(int sign)
0 commit comments