public bool MoveNext()
{
- if (_sentinel != null)
+ if ((_sentinel != null) && (_hashtableContentsToEnumerate != null))
{
- if ((_hashtableContentsToEnumerate != null) && (_index < _hashtableContentsToEnumerate.Length))
+ for (; _index < _hashtableContentsToEnumerate.Length; _index++)
{
- for (; _index < _hashtableContentsToEnumerate.Length; _index++)
+ if ((_hashtableContentsToEnumerate[_index] != null) && (_hashtableContentsToEnumerate[_index] != _sentinel))
{
- if ((_hashtableContentsToEnumerate[_index] != null) && (_hashtableContentsToEnumerate[_index] != _sentinel))
- {
- _current = _hashtableContentsToEnumerate[_index];
- _index++;
- return true;
- }
+ _current = _hashtableContentsToEnumerate[_index];
+ _index++;
+ return true;
}
}
- }
- if ((_index == _hashtableContentsToEnumerate.Length) && _sentinel != null)
- {
- _current = _sentinel;
- _index++;
- return true;
+ if (_index == _hashtableContentsToEnumerate.Length)
+ {
+ _current = _sentinel;
+ _index++;
+ return true;
+ }
}
_current = default(TValue);