From: Ben Beltran Date: Sat, 20 May 2017 16:19:19 +0000 (-0500) Subject: Remove async lock even if track not found X-Git-Tag: 0.2.0^2~2^2~4 X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/commitdiff_plain/d0705bff97871fc62a9d7737dadbe4fdb39b2f79?ds=sidebyside Remove async lock even if track not found --- diff --git a/Sources/lyrics_engine.swift b/Sources/lyrics_engine.swift index 85e4735..27e0e11 100644 --- a/Sources/lyrics_engine.swift +++ b/Sources/lyrics_engine.swift @@ -36,11 +36,9 @@ class LyricsEngine { // Call the API and unlock when you're done fetchLyricsFromAPI(withURL: url, completionHandler: {lyricsResult -> Void in - if let lyricsResult = lyricsResult { - lyrics = lyricsResult - requestFinished = true - asyncLock.signal() - } + lyrics = lyricsResult + requestFinished = true + asyncLock.signal() }) while !requestFinished {