Simplify the numberOfLocalCommits function
This commit is contained in:
parent
c5f95cfc8f
commit
1d07559393
1 changed files with 2 additions and 7 deletions
|
|
@ -801,15 +801,10 @@ public class PasswordStore {
|
||||||
|
|
||||||
public func numberOfLocalCommits() -> Int {
|
public func numberOfLocalCommits() -> Int {
|
||||||
do {
|
do {
|
||||||
if let localCommits = try getLocalCommits() {
|
return try getLocalCommits()?.count ?? 0
|
||||||
return localCommits.count
|
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
} catch {
|
} catch {
|
||||||
print(error)
|
return 0
|
||||||
}
|
}
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func getLocalCommits() throws -> [GTCommit]? {
|
private func getLocalCommits() throws -> [GTCommit]? {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue