]> err.no Git - sope/blobdiff - sope-ical/NGiCal/iCalRecurrenceCalculator.m
improved byday (failure) handling
[sope] / sope-ical / NGiCal / iCalRecurrenceCalculator.m
index 9d2febd729be97dc54fb69c474ddc40add207943..6e048f7eff5387fef2cd0bdf2cf9898549da1a3d 100644 (file)
@@ -269,9 +269,9 @@ static Class yearlyCalcClass  = Nil;
 - (NGCalendarDateRange *)lastInstanceCalendarDateRange {
   NSCalendarDate *start, *end;
 
-  start = [self lastInstanceStartDate];
-  if (!start)
+  if ((start = [self lastInstanceStartDate]) == nil)
     return nil;
+  
   end   = [start addTimeInterval:[self->firstRange duration]];
   return [NGCalendarDateRange calendarDateRangeWithStartDate:start
                               endDate:end];
@@ -280,12 +280,14 @@ static Class yearlyCalcClass  = Nil;
 - (NSCalendarDate *)lastInstanceStartDate {
   NSCalendarDate *until;
   
-  /* NOTE: this is horribly inaccurate and doesn't even consider the use
-  of repeatCount. It MUST be implemented by subclasses properly! However,
-  it does the trick for SOGO 1.0 - that's why it's left here.
+  /* 
+     NOTE: this is horribly inaccurate and doesn't even consider the use
+           of repeatCount. It MUST be implemented by subclasses properly!
+          However, it does the trick for SOGo 1.0 - that's why it's left here.
   */
   if ((until = [self->rrule untilDate]) != nil)
     return until;
+  
   return nil;
 }