0

iterator code bug

abcd 3 years ago 0
How do we ever break out of this loop? If inherited next gets to the end of the list it will return false but this next will just go back to the top of the repeat.
  function TBadCustomerIterator.Next: Boolean;
  begin
    repeat
      Result := inherited Next;
    until Result and CurrentItem.CreditStop.
  end;