Skip to content

Commit

Permalink
fix the compiler crash
Browse files Browse the repository at this point in the history
Randomly checkout the upstream version of the crashed function.
  • Loading branch information
AleksandrSemakin committed Dec 7, 2024
1 parent 84e658b commit 255e615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ChatLayout/Classes/Core/Model/StateController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,15 @@ final class StateController<Layout: ChatLayoutRepresentation> {
// 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)
}
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..<section.items.count {
let itemPath = ItemPath(item: itemIndex, section: sectionIndex)
if let itemAttributes = itemAttributes(for: itemPath, kind: .cell, at: state, additionalAttributes: additionalAttributes) {
attributes.append(itemAttributes)
Expand Down

0 comments on commit 255e615

Please sign in to comment.