This commit is contained in:
zeus
2025-01-28 12:28:03 +08:00
parent 738c373a77
commit ec96756800
2534 changed files with 486292 additions and 0 deletions
@@ -0,0 +1,19 @@
/// A case-preserving, case-insensitive identifier
/// that matches the ASCII version of sqlite3_stricmp
struct CaseInsensitiveIdentifier: Hashable {
private let lowercased: String
let rawValue: String
init(rawValue: String) {
self.lowercased = rawValue.lowercased()
self.rawValue = rawValue
}
static func == (lhs: CaseInsensitiveIdentifier, rhs: CaseInsensitiveIdentifier) -> Bool {
lhs.lowercased == rhs.lowercased
}
func hash(into hasher: inout Hasher) {
hasher.combine(lowercased)
}
}