mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Optimizing function calls
Thanks for @ktprograms advice
This commit is contained in:
@@ -270,7 +270,7 @@ extension FetchProvisioningProfilesOperation
|
||||
}
|
||||
//App ID name must be ascii. If the name is not ascii, using bundleID instead
|
||||
let appIDName: String
|
||||
if containsNonASCII(text: name) {
|
||||
if !name.allSatisfy({ $0.isASCII }) {
|
||||
//Contains non ASCII (Such as Chinese/Japanese...), using bundleID
|
||||
appIDName = bundleIdentifier
|
||||
}else {
|
||||
@@ -523,13 +523,3 @@ extension FetchProvisioningProfilesOperation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func containsNonASCII(text: String) -> Bool {
|
||||
let ascii = CharacterSet(charactersIn: "\0"..."~")
|
||||
for scalar in text.unicodeScalars {
|
||||
if !ascii.contains(scalar) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user