mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Better checks for Swift < 4.1 (thanks @hartbit!)
This commit is contained in:
1 parent
9505ba1606
commit
1cbe60a13f
8 files changed
+10
-20
No files matched your search
@@ -841,8 +841,7 @@ extension Database {
|
||||
self.rawValue = rawValue
|
||||
}
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
/// The hash value
|
||||
/// :nodoc:
|
||||
public var hashValue: Int {
|
||||
@@ -881,8 +880,7 @@ extension Database {
|
||||
self.rawValue = rawValue
|
||||
}
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
/// The hash value
|
||||
/// :nodoc:
|
||||
public var hashValue: Int {
|
||||
|
||||
@@ -139,8 +139,7 @@ public struct ResultCode : RawRepresentable, Equatable, CustomStringConvertible
|
||||
public static let SQLITE_OK_LOAD_PERMANENTLY = ResultCode(rawValue: (SQLITE_OK.rawValue | (1<<8)))
|
||||
}
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
// Equatable
|
||||
extension ResultCode {
|
||||
/// :nodoc:
|
||||
|
||||
@@ -11,8 +11,7 @@ public final class DatabaseFunction: Hashable {
|
||||
let name: String
|
||||
let nArg: Int32 // -1 for variadic functions
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
var hashValue: Int {
|
||||
return name.hashValue ^ nArg.hashValue
|
||||
}
|
||||
|
||||
@@ -255,8 +255,7 @@ private struct TableRegion: Equatable {
|
||||
return false
|
||||
}
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
static func == (lhs: TableRegion, rhs: TableRegion) -> Bool {
|
||||
if lhs.columns != rhs.columns { return false }
|
||||
if lhs.rowIds != rhs.rowIds { return false }
|
||||
|
||||
@@ -911,8 +911,7 @@ extension StatementArguments {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
// Equatable
|
||||
extension StatementArguments {
|
||||
/// :nodoc:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Compatibility layer for Swift < 4.1
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
extension Sequence {
|
||||
// From future import SE-0187
|
||||
func compactMap<ElementOfResult>(_ transform: (Self.Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
|
||||
|
||||
@@ -486,8 +486,7 @@ public struct SQLFunctionName : Hashable {
|
||||
self.sql = sql
|
||||
}
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
/// The hash value
|
||||
///
|
||||
/// :nodoc:
|
||||
|
||||
@@ -985,8 +985,7 @@ private struct InsertQuery: Hashable {
|
||||
// Not generated by Swift 4.1
|
||||
var hashValue: Int { return tableName.hashValue }
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
static func == (lhs: InsertQuery, rhs: InsertQuery) -> Bool {
|
||||
if lhs.tableName != rhs.tableName { return false }
|
||||
if lhs.onConflict != rhs.onConflict { return false }
|
||||
@@ -1027,8 +1026,7 @@ private struct UpdateQuery: Hashable {
|
||||
// Not generated by Swift 4.1
|
||||
var hashValue: Int { return tableName.hashValue }
|
||||
|
||||
#if swift(>=4.1)
|
||||
#else
|
||||
#if !swift(>=4.1)
|
||||
static func == (lhs: UpdateQuery, rhs: UpdateQuery) -> Bool {
|
||||
if lhs.tableName != rhs.tableName { return false }
|
||||
if lhs.onConflict != rhs.onConflict { return false }
|
||||
|
||||
Reference in new issue
Block a user