mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-06 21:22:44 +00:00
Consider the deduce compiler flag for duplicate elements in a subtree (#2922)
This commit is contained in:
committed by
GitHub
parent
a2cd79d406
commit
9a5f6d3ece
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user