Simplify the numberOfLocalCommits function

This commit is contained in:
Bob Sun 2018-11-16 21:12:47 -08:00
parent c5f95cfc8f
commit 1d07559393
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -801,15 +801,10 @@ public class PasswordStore {
public func numberOfLocalCommits() -> Int {
do {
if let localCommits = try getLocalCommits() {
return localCommits.count
} else {
return 0
}
return try getLocalCommits()?.count ?? 0
} catch {
print(error)
return 0
}
return 0
}
private func getLocalCommits() throws -> [GTCommit]? {