We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e313d3 commit e17f382Copy full SHA for e17f382
1 file changed
NCrontab.Advanced/Filters/RangeFilter.cs
@@ -98,7 +98,12 @@ private bool IsMatch(int evalValue)
98
99
var newValue = (int?) value + 1;
100
while (newValue < max && !IsMatch(newValue.Value))
101
+ {
102
+ // short circuit, `IsMatch` can never be true
103
+ if (newValue > End)
104
+ newValue = max;
105
newValue++;
106
+ }
107
108
if (newValue > max) newValue = null;
109
@@ -118,7 +123,12 @@ public int First()
118
123
119
124
var newValue = 0;
120
125
while (newValue < max && !IsMatch(newValue))
126
127
128
129
121
130
131
122
132
133
if (newValue > max)
134
throw new CrontabException(string.Format("Next value for {0} on field {1} could not be found!",
0 commit comments