From 4af56e48bf9eb8163ea33e1749a7f90bf660bc84 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 24 Oct 2023 14:56:39 -0400 Subject: [PATCH] Clean up TimelineLikeCollectionViewController.apply(_:animatingDifferences:) --- .../Utilities/TimelineLikeCollectionViewController.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift b/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift index 6cf2ae5b..697e6b35 100644 --- a/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift +++ b/Tusker/Screens/Utilities/TimelineLikeCollectionViewController.swift @@ -211,11 +211,9 @@ extension TimelineLikeCollectionViewController { extension TimelineLikeCollectionViewController { // apply(_:animatingDifferences:) is marked as nonisolated, so just awaiting it doesn't dispatch to the main thread, unlike other async @MainActor methods // but we always want to update the data source on the main thread for consistency, so this method does that + @MainActor func apply(_ snapshot: NSDiffableDataSourceSnapshot, animatingDifferences: Bool) async { - let task = Task { @MainActor in - self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences) - } - await task.value + await self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences) } @MainActor