From 255e615ad4399d372edeee9dd198016f5abb5c9d Mon Sep 17 00:00:00 2001 From: Aleksandr Semakin Date: Sat, 7 Dec 2024 18:27:52 +0400 Subject: [PATCH] fix the compiler crash Randomly checkout the upstream version of the crashed function. --- ChatLayout/Classes/Core/Model/StateController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChatLayout/Classes/Core/Model/StateController.swift b/ChatLayout/Classes/Core/Model/StateController.swift index a0871795..d8d2f0e1 100644 --- a/ChatLayout/Classes/Core/Model/StateController.swift +++ b/ChatLayout/Classes/Core/Model/StateController.swift @@ -926,7 +926,7 @@ final class StateController { // Debug purposes only. var attributes = [ChatLayoutAttributes]() attributes.reserveCapacity(layout.sections.reduce(into: 0) { $0 += $1.items.count }) - layout.sections.enumerated().forEach { sectionIndex, section in + for (sectionIndex, section) in layout.sections.enumerated() { let sectionPath = ItemPath(item: 0, section: sectionIndex) if let headerAttributes = itemAttributes(for: sectionPath, kind: .header, at: state, additionalAttributes: additionalAttributes) { attributes.append(headerAttributes) @@ -934,7 +934,7 @@ final class StateController { if let footerAttributes = itemAttributes(for: sectionPath, kind: .footer, at: state, additionalAttributes: additionalAttributes) { attributes.append(footerAttributes) } - section.items.enumerated().forEach { itemIndex, _ in + for itemIndex in 0..