             lp.resolveLayoutDirection(layoutDirection)
             
             if (lp.hidden) {
-                i += getChildrenSkipCount(child, index: i)
+                measureIdx0 += getChildrenSkipCount(child, index: measureIdx0) + 1 // combined with measureIdx0++
                 continue
             }
             
-            if (hasDividerBeforeChildAt(i)) {
+            if (hasDividerBeforeChildAt(measureIdx0)) {
                 self.totalLength += dividerSize.height
             }
             

            dir = -1
        }
        
        for var i = 0; i < count; i++ {
            let childIndex = start + dir * i
            guard let child = getVirtualChildAt(childIndex) else {
                childLeft += measureNullChild(childIndex)
                continue
            }
            

                alternativeMaxWidth = max(alternativeMaxWidth, matchWidthLocally ? margin : measuredWidth)
            }
            
            measureIdx0 += getChildrenSkipCount(child, index: measureIdx0) + 1 // combined with measureIdx0++
        }
        
        if (totalLength > 0 && hasDividerBeforeChildAt(count)) {
