MXKRoomBubbleCellData: Improve getFirstBubbleComponentWithDisplay and getLastBubbleComponentWithDisplay.

This commit is contained in:
SBiOSoftWhare 2022-01-20 16:01:45 +01:00
parent 4b2e9bb8ac
commit 5ae11d1744

View file

@ -313,9 +313,8 @@
@synchronized(bubbleComponents)
{
for (NSInteger index = 0; index < bubbleComponents.count; index++)
for (MXKRoomBubbleComponent *component in bubbleComponents)
{
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (component.attributedTextMessage)
{
first = component;
@ -334,12 +333,12 @@
@synchronized(bubbleComponents)
{
for (NSInteger index = 0; index < bubbleComponents.count; index++)
for (MXKRoomBubbleComponent *component in bubbleComponents.reverseObjectEnumerator)
{
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (component.attributedTextMessage)
{
lastVisibleComponent = component;
break;
}
}
}