Skip to content

Commit 1de9a94

Browse files
committed
Remove duplicate code in NSCalendar
1 parent 91e5c25 commit 1de9a94

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

Foundation/NSCalendar.swift

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -643,21 +643,6 @@ open class NSCalendar : NSObject, NSCopying, NSSecureCoding {
643643
} else {
644644
dayValuePointer?.pointee = NSDateComponentUndefined
645645
}
646-
if let value = comps.year {
647-
yearValuePointer?.pointee = value
648-
} else {
649-
yearValuePointer?.pointee = NSDateComponentUndefined
650-
}
651-
if let value = comps.month {
652-
monthValuePointer?.pointee = value
653-
} else {
654-
monthValuePointer?.pointee = NSDateComponentUndefined
655-
}
656-
if let value = comps.day {
657-
dayValuePointer?.pointee = value
658-
} else {
659-
dayValuePointer?.pointee = NSDateComponentUndefined
660-
}
661646
}
662647

663648
/*
@@ -686,21 +671,6 @@ open class NSCalendar : NSObject, NSCopying, NSSecureCoding {
686671
} else {
687672
weekdayValuePointer?.pointee = NSDateComponentUndefined
688673
}
689-
if let value = comps.yearForWeekOfYear {
690-
yearValuePointer?.pointee = value
691-
} else {
692-
yearValuePointer?.pointee = NSDateComponentUndefined
693-
}
694-
if let value = comps.weekOfYear {
695-
weekValuePointer?.pointee = value
696-
} else {
697-
weekValuePointer?.pointee = NSDateComponentUndefined
698-
}
699-
if let value = comps.weekday {
700-
weekdayValuePointer?.pointee = value
701-
} else {
702-
weekdayValuePointer?.pointee = NSDateComponentUndefined
703-
}
704674
}
705675

706676
/*
@@ -729,21 +699,6 @@ open class NSCalendar : NSObject, NSCopying, NSSecureCoding {
729699
} else {
730700
nanosecondValuePointer?.pointee = NSDateComponentUndefined
731701
}
732-
if let value = comps.minute {
733-
minuteValuePointer?.pointee = value
734-
} else {
735-
minuteValuePointer?.pointee = NSDateComponentUndefined
736-
}
737-
if let value = comps.second {
738-
secondValuePointer?.pointee = value
739-
} else {
740-
secondValuePointer?.pointee = NSDateComponentUndefined
741-
}
742-
if let value = comps.nanosecond {
743-
nanosecondValuePointer?.pointee = value
744-
} else {
745-
nanosecondValuePointer?.pointee = NSDateComponentUndefined
746-
}
747702
}
748703

749704
/*

0 commit comments

Comments
 (0)