typo bug in appointment search?
Posted: Wed Sep 08, 2010 2:07 pm
Lines ~ 127-135 from AppointmentL.cs read:
I'm not sure what the break statement is trying to achieve, but I'm guessing the idea is to stop trying other providers if you find one already for that time slot. Is this correct? In that event, I believe there's a typo, and the code should be modified to look like below:
I'm finding that the code as written has the side-effect that if only one provider is selected to search (or probably also if the LAST provider matches an appointment), it only finds one time slot per day (b/c the break statement is breaking the iteration through the slots in the day, not the providers).
Additionally, maybe the break doesn't need to be inside an if condition, because all branches that arrive to that if statement should have aptIsMatch set to true.
Best regards,
Code: Select all
//match found
ALresults.Add(dayEvaluating+timeFound);
}//for p
if(aptIsMatch){
break;
}
}
dayEvaluating=dayEvaluating.AddDays(1);//move to the next day
Code: Select all
//match found
ALresults.Add(dayEvaluating+timeFound);
if(aptIsMatch){ //Unneccessary check? This looks like a tautology...
break;
}
}//for p
}
dayEvaluating=dayEvaluating.AddDays(1);//move to the next day
Additionally, maybe the break doesn't need to be inside an if condition, because all branches that arrive to that if statement should have aptIsMatch set to true.
Best regards,