How can I get rid of this goto?
24.09.2009 - 22:01 (2 years, 4 months, 1 week, 5 days ago)
Help! It's late and I don't see a good way to get rid of this goto construct:
private void advanceTheTimeCursor(
Func<DateTime> nextTime,
Action uponSuccessfulAdvancement)
{
loop:
var t = nextTime();
if (t > reference) return;
uponSuccessfulAdvancement();
pastToPresentCursor = t;
goto loop;
}
I kinda like it, but somebody said somewhere gotos are considered harmful...