From 78a6f7251b4677075eacd374699b4712b2fedd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 14 Jul 2018 11:32:24 +0200 Subject: [PATCH] Spot a few Demeter law violations --- GRDB/Core/RowAdapter.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GRDB/Core/RowAdapter.swift b/GRDB/Core/RowAdapter.swift index 9351440cbc..0f68e839fc 100644 --- a/GRDB/Core/RowAdapter.swift +++ b/GRDB/Core/RowAdapter.swift @@ -493,12 +493,12 @@ struct AdaptedRowImpl : RowImpl { func hasNull(atUncheckedIndex index: Int) -> Bool { let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index) - return base.impl.hasNull(atUncheckedIndex: mappedIndex) + return base.impl.hasNull(atUncheckedIndex: mappedIndex) // base.impl: Demeter violation } func databaseValue(atUncheckedIndex index: Int) -> DatabaseValue { let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index) - return base.impl.databaseValue(atUncheckedIndex: mappedIndex) + return base.impl.databaseValue(atUncheckedIndex: mappedIndex) // base.impl: Demeter violation } func fastDecode( @@ -507,7 +507,7 @@ struct AdaptedRowImpl : RowImpl { debugInfo: @autoclosure () -> ValueConversionDebuggingInfo) throws -> Value { let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index) - return try base.impl.fastDecode(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo) + return try base.impl.fastDecode(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo) // base.impl: Demeter violation } func fastDecodeIfPresent( @@ -516,7 +516,7 @@ struct AdaptedRowImpl : RowImpl { debugInfo: @autoclosure () -> ValueConversionDebuggingInfo) throws -> Value? { let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index) - return try base.impl.fastDecodeIfPresent(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo) + return try base.impl.fastDecodeIfPresent(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo) // base.impl: Demeter violation } func dataNoCopy( @@ -524,7 +524,7 @@ struct AdaptedRowImpl : RowImpl { debugInfo: @autoclosure () -> ValueConversionDebuggingInfo) throws -> Data? { let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index) - return try base.impl.dataNoCopy(atUncheckedIndex: mappedIndex, debugInfo: debugInfo) + return try base.impl.dataNoCopy(atUncheckedIndex: mappedIndex, debugInfo: debugInfo) // base.impl: Demeter violation } func columnName(atUncheckedIndex index: Int) -> String {