         
         let expectedIndex = expectedIndex ?? index
         let expectedDiff = CGFloat(max(1, abs(expectedIndex - index)))
-        let expectedPosition = self.calculatePagePosition(for: currentContentOffset,
-                                                 pageSize: pageSize,
-                                                 indexDiff: expectedDiff) ?? CGFloat(index)
-        
-        guard self.isInfinitelyScrolling(forPosition: expectedPosition) == false else {
+        let expectedPosition = calculatePagePosition(for: currentContentOffset,
+                                                     pageSize: pageSize,
+                                                     indexDiff: expectedDiff) ?? CGFloat(index)
+        
+        guard !isInfinitelyScrolling(forPosition: expectedPosition) else {
             return 1
         }
         return expectedDiff

        if autoScroller.restartsOnScrollEnd {
            autoScroller.restart()
        }
        self.expectedTransitionIndex = nil
    }
}


    /// - Parameter pagePosition: the current page position.
    /// - Returns: The updated page position (if needed).
    private func adjustedPagePositionForInfiniteOverscroll(from pagePosition: CGFloat) -> CGFloat? {
        guard isInfinitelyScrolling(forPosition: pagePosition) else {
            return nil
        }
        
        let maxPagePosition = CGFloat((viewControllerCount ?? 1) - 1)
        var integral: Double = 0.0
        var progress = CGFloat(modf(fabs(Double(pagePosition)), &integral))
        var maxInfinitePosition: CGFloat!
