Skip to content

Commit 72973f6

Browse files
Fix warning
1 parent 52575c1 commit 72973f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/NSCalendar.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,7 @@ - (BOOL)nextWeekendStartDate:(out NSDate * _Nullable *)datep interval:(out NSTim
11361136
NSInteger day = [self component:NSCalendarUnitWeekday fromDate:date];
11371137
NSInteger daysUntil;
11381138
BOOL back = (options & NSCalendarSearchBackwards) == NSCalendarSearchBackwards;
1139+
NSDate *next;
11391140

11401141
if (back) {
11411142
// previous Monday
@@ -1145,7 +1146,7 @@ - (BOOL)nextWeekendStartDate:(out NSDate * _Nullable *)datep interval:(out NSTim
11451146
daysUntil = 7 - (day % 7);
11461147
}
11471148

1148-
NSDate *next = [self dateByAddingUnit:NSDayCalendarUnit value:daysUntil toDate:date options:0];
1149+
next = [self dateByAddingUnit:NSDayCalendarUnit value:daysUntil toDate:date options:0];
11491150
next = [self startOfDayForDate:next];
11501151

11511152
if (back) {

0 commit comments

Comments
 (0)