Skip to content

Commit

Permalink
refactor: replace map function with if let structure
Browse files Browse the repository at this point in the history
  • Loading branch information
higuaifan authored and yichengchen committed May 20, 2024
1 parent 153be6c commit c2bb750
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class VideoDetailViewController: UIViewController {

if let season = data.View.ugc_season {
if season.sections.count > 1 {
season.sections.first(where: { section in section.episodes.contains(where: { episode in episode.aid == data.View.aid }) }).map { section in
if let section = season.sections.first(where: { section in section.episodes.contains(where: { episode in episode.aid == data.View.aid }) }) {
allUgcEpisodes = section.episodes
}
} else {
Expand Down

0 comments on commit c2bb750

Please sign in to comment.