Skip to content

Commit

Permalink
Simplify simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseoldduck committed Jul 12, 2018
1 parent b400cac commit 0c949c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Source/Layout/ASLayout+IGListKit.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@ @implementation ASLayout(IGListKit)

- (id <NSObject>)diffIdentifier
{
return [NSValue valueWithPointer: (__bridge void*) self->_layoutElement];
return self->_layoutElement;
}

- (BOOL)isEqualToDiffableObject:(id <IGListDiffable>)other
{
if (other == self) return YES;

ASLayout *otherLayout = ASDynamicCast(other, ASLayout);
if (!otherLayout) return NO;

return (otherLayout->_layoutElement == self->_layoutElement);
return [self isEqual:other];
}
@end
#endif // AS_IG_LIST_KIT
2 changes: 2 additions & 0 deletions Source/Layout/ASLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ - (ASLayout *)filteredNodeLayoutTree NS_RETURNS_RETAINED

- (BOOL)isEqual:(id)object
{
if (self == object) return YES;

ASLayout *layout = ASDynamicCast(object, ASLayout);
if (layout == nil) {
return NO;
Expand Down

0 comments on commit 0c949c4

Please sign in to comment.