Simplify code

This commit is contained in:
Danny Moesch 2018-12-15 21:49:18 +01:00 committed by Bob Sun
parent 9e027b878a
commit 64956c6643
2 changed files with 7 additions and 9 deletions

View file

@ -12,13 +12,10 @@ import SwiftyUserDefaults
extension PasswordEntity {
public var nameWithCategory: String {
get {
if let p = path, p.hasSuffix(".gpg") {
return String(p.prefix(upTo: p.index(p.endIndex, offsetBy: -4)))
} else {
return ""
}
if let p = path, p.hasSuffix(".gpg") {
return String(p.prefix(upTo: p.index(p.endIndex, offsetBy: -4)))
}
return ""
}
public func getCategoryText() -> String {