From 8752d37dd4a5df519fa6b9dfa6d82c18ba5151d9 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Sun, 1 Dec 2024 16:10:22 +0800 Subject: [PATCH] macosx: Remove unnecessary ifs in scroll to view Signed-off-by: Claudio Cambra --- .../macosx/library/VLCLibraryCollectionViewFlowLayout.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewFlowLayout.m b/modules/gui/macosx/library/VLCLibraryCollectionViewFlowLayout.m index 957cf386e4..f010181e6f 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewFlowLayout.m +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewFlowLayout.m @@ -188,11 +188,9 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink, if (!newItemOnSameRow) { [self animateDetailViewWithAnimation:VLCDetailViewAnimationTypeExpand]; - if (indexPath != nil && self.collectionView != nil) { - NSRect frame = [self.collectionView layoutAttributesForItemAtIndexPath:indexPath].frame; - frame.size.height += [self finalExpandedHeight]; - [self.collectionView.animator scrollRectToVisible:frame]; - } + NSRect frame = [self.collectionView layoutAttributesForItemAtIndexPath:indexPath].frame; + frame.size.height += [self finalExpandedHeight]; + [self.collectionView.animator scrollRectToVisible:frame]; } else { _animationIsCollapse = NO; }