diff --git a/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm b/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm index 370f533980..eea54f5028 100644 --- a/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm +++ b/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm @@ -79,6 +79,7 @@ static BOOL ASElementExistsAtIndexPathForMultidimensionalArray(NSArray *array, N NSUInteger indexes[indexesLength]; [indexPath getIndexes:indexes range:NSMakeRange(1, indexesLength)]; NSIndexPath *indexPathByRemovingFirstIndex; + // Use -indexPathForItem:inSection: if possible because it does not allocate into the heap if (indexesLength == 2) { indexPathByRemovingFirstIndex = [NSIndexPath indexPathForItem:indexes[1] inSection:indexes[0]]; } else {