Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 9a5f6d3

Browse files
authored
Consider the deduce compiler flag for duplicate elements in a subtree (#2922)
1 parent a2cd79d commit 9a5f6d3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2823,13 +2823,15 @@ - (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
28232823
// Certain properties are necessary to set on an element of type ASLayoutSpec
28242824
if (layoutElement.layoutElementType == ASLayoutElementTypeLayoutSpec) {
28252825
ASLayoutSpec *layoutSpec = (ASLayoutSpec *)layoutElement;
2826-
2826+
2827+
#if AS_DEDUPE_LAYOUT_SPEC_TREE
28272828
NSSet *duplicateElements = [layoutSpec findDuplicatedElementsInSubtree];
28282829
if (duplicateElements.count > 0) {
28292830
ASDisplayNodeFailAssert(@"Node %@ returned a layout spec that contains the same elements in multiple positions. Elements: %@", self, duplicateElements);
28302831
// Use an empty layout spec to avoid crashes
28312832
layoutSpec = [[ASLayoutSpec alloc] init];
28322833
}
2834+
#endif
28332835

28342836
if (_shouldCacheLayoutSpec) {
28352837
_layoutSpec = layoutSpec;

0 commit comments

Comments
 (0)