From 9a5f6d3ece33c443be2033ea17ea0c7b6df2fd61 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Mon, 23 Jan 2017 17:03:54 -0800 Subject: [PATCH] Consider the deduce compiler flag for duplicate elements in a subtree (#2922) --- AsyncDisplayKit/ASDisplayNode.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index ea186a72c5..f5fa704925 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -2823,13 +2823,15 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) // Certain properties are necessary to set on an element of type ASLayoutSpec if (layoutElement.layoutElementType == ASLayoutElementTypeLayoutSpec) { ASLayoutSpec *layoutSpec = (ASLayoutSpec *)layoutElement; - + +#if AS_DEDUPE_LAYOUT_SPEC_TREE NSSet *duplicateElements = [layoutSpec findDuplicatedElementsInSubtree]; if (duplicateElements.count > 0) { ASDisplayNodeFailAssert(@"Node %@ returned a layout spec that contains the same elements in multiple positions. Elements: %@", self, duplicateElements); // Use an empty layout spec to avoid crashes layoutSpec = [[ASLayoutSpec alloc] init]; } +#endif if (_shouldCacheLayoutSpec) { _layoutSpec = layoutSpec;