private void TrySetLap(int driverId, PostedTime time)
{
var isSessionBest = time.Type == PostedTimeType.SessionBest ||
// We only receive session best lap times during a race session so we determine here
// if the specified time should be promoted.
(CurrentSessionType != SessionType.Race && (Lap == null || time.Time < Lap.Time));
if(isSessionBest)
{
SetLap(driverId, time.Time, time.LapNumber);
}
}