mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 11:50:56 +00:00
[Documentation] Add a comment why we prefer -indexPathForItem:inSection:
This commit is contained in:
parent
457e08005f
commit
77f24231b3
@ -79,6 +79,7 @@ static BOOL ASElementExistsAtIndexPathForMultidimensionalArray(NSArray *array, N
|
|||||||
NSUInteger indexes[indexesLength];
|
NSUInteger indexes[indexesLength];
|
||||||
[indexPath getIndexes:indexes range:NSMakeRange(1, indexesLength)];
|
[indexPath getIndexes:indexes range:NSMakeRange(1, indexesLength)];
|
||||||
NSIndexPath *indexPathByRemovingFirstIndex;
|
NSIndexPath *indexPathByRemovingFirstIndex;
|
||||||
|
// Use -indexPathForItem:inSection: if possible because it does not allocate into the heap
|
||||||
if (indexesLength == 2) {
|
if (indexesLength == 2) {
|
||||||
indexPathByRemovingFirstIndex = [NSIndexPath indexPathForItem:indexes[1] inSection:indexes[0]];
|
indexPathByRemovingFirstIndex = [NSIndexPath indexPathForItem:indexes[1] inSection:indexes[0]];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user