diff --git a/GRDB/Core/DatabaseValueConversion.swift b/GRDB/Core/DatabaseValueConversion.swift index ebc9b6334..e8a6efb25 100644 --- a/GRDB/Core/DatabaseValueConversion.swift +++ b/GRDB/Core/DatabaseValueConversion.swift @@ -76,7 +76,6 @@ extension ValueConversionContext { column: nil) } } - } /// The canonical conversion error message @@ -153,15 +152,6 @@ extension DatabaseValueConvertible { } extension Row { - @inline(__always) - func decodeIfPresent( - _ type: Value.Type, - atUncheckedIndex index: Int, - conversionContext: @autoclosure () -> ValueConversionContext?) -> Value? - { - return Value.decodeIfPresent(from: impl.databaseValue(atUncheckedIndex: index), conversionContext: conversionContext) - } - @inline(__always) func decode( _ type: Value.Type, @@ -170,6 +160,15 @@ extension Row { { return Value.decode(from: impl.databaseValue(atUncheckedIndex: index), conversionContext: conversionContext) } + + @inline(__always) + func decodeIfPresent( + _ type: Value.Type, + atUncheckedIndex index: Int, + conversionContext: @autoclosure () -> ValueConversionContext?) -> Value? + { + return Value.decodeIfPresent(from: impl.databaseValue(atUncheckedIndex: index), conversionContext: conversionContext) + } } // MARK: - DatabaseValueConvertible & StatementColumnConvertible @@ -195,18 +194,6 @@ extension DatabaseValueConvertible where Self: StatementColumnConvertible { } extension Row { - @inline(__always) - func fastDecodeIfPresent( - _ type: Value.Type, - atUncheckedIndex index: Int, - conversionContext: @autoclosure () -> ValueConversionContext?) -> Value? - { - if let sqliteStatement = sqliteStatement { - return Value.fastDecodeIfPresent(from: sqliteStatement, index: Int32(index)) - } - return impl.fastDecodeIfPresent(Value.self, atUncheckedIndex: index, conversionContext: conversionContext) - } - @inline(__always) func fastDecode( _ type: Value.Type, @@ -218,4 +205,16 @@ extension Row { } return impl.fastDecode(Value.self, atUncheckedIndex: index, conversionContext: conversionContext) } + + @inline(__always) + func fastDecodeIfPresent( + _ type: Value.Type, + atUncheckedIndex index: Int, + conversionContext: @autoclosure () -> ValueConversionContext?) -> Value? + { + if let sqliteStatement = sqliteStatement { + return Value.fastDecodeIfPresent(from: sqliteStatement, index: Int32(index)) + } + return impl.fastDecodeIfPresent(Value.self, atUncheckedIndex: index, conversionContext: conversionContext) + } }