Skip to content

Commit

Permalink
Rename isEnglishLetter to isBasicLatinLetter to be more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiu committed May 19, 2024
1 parent 74f52b9 commit 3134e8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/NostrSDK/Filter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public struct Filter: Codable, Hashable, Equatable {
self.limit = limit

if let tags {
guard tags.keys.allSatisfy({ $0.isEnglishLetter }) else {
guard tags.keys.allSatisfy({ $0.isBasicLatinLetter }) else {
return nil
}
}
Expand Down Expand Up @@ -113,7 +113,7 @@ public struct Filter: Codable, Hashable, Equatable {
for key in tagsContainer.allKeys {
let tagName = key.stringValue

if tagName.count == 2 && tagName.first == "#", let tagCharacter = tagName.last, tagCharacter.isEnglishLetter {
if tagName.count == 2 && tagName.first == "#", let tagCharacter = tagName.last, tagCharacter.isBasicLatinLetter {
decodedTags[tagCharacter] = try tagsContainer.decode([String].self, forKey: key)
}
}
Expand Down Expand Up @@ -141,7 +141,7 @@ public struct Filter: Codable, Hashable, Equatable {
}

private extension Character {
var isEnglishLetter: Bool {
var isBasicLatinLetter: Bool {
(self >= "A" && self <= "Z") || (self >= "a" && self <= "z")
}
}

0 comments on commit 3134e8a

Please sign in to comment.