             }
         }
         
-        for path in indexPathsToReselect {
-            if let date = dateOwnerInfoFromPath(path)?.date {
-                newDates.append(date)
-            }
-        }
-        theSelectedDates = newDates
+
+        theSelectedDates = indexPathsToReselect.flatMap { return  dateOwnerInfoFromPath($0)?.date }
         theSelectedIndexPaths = indexPathsToReselect
     }
 

            updateLayoutItemSize()
            if calendarViewLayout.itemSize != lastSize {
                lastSize = calendarViewLayout.itemSize
                if finalLoadable == nil, delegate != nil { // This will only be set once
                    finalLoadable = true
                    self.reloadData() { self.executeDelayedTasks() }
                }
            }


    var delayedExecutionClosure: [(() -> Void)] = []
    var lastSize = CGSize.zero
    var calendarIsAlreadyLoaded: Bool = false

    var startDateCache: Date {
        get { return cachedConfiguration.startDate }
    }

    var endDateCache: Date {
        get { return cachedConfiguration.endDate }
    }

    var calendar: Calendar {
        get { return cachedConfiguration.calendar }
    }
    // Configuration parameters from the dataSource
    var cachedConfiguration: ConfigurationParameters!
