Skip to content

Commit c7749ce

Browse files
committed
Remove dead code path.
1 parent 7002959 commit c7749ce

1 file changed

Lines changed: 4 additions & 22 deletions

File tree

src/RepoDb/Cachers/CommandTextCache.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,8 @@ private static IEnumerable<Field> GetTargetFields(IDbConnection connection,
12031203
{
12041204
return [];
12051205
}
1206-
var dbFields = DbFieldCache.Get(connection, tableName, transaction);
1207-
return GetTargetFieldsInternal(fields, dbFields, connection.GetDbSetting());
1206+
var dbFields = DbFieldCache.Get(connection, tableName, transaction, enableValidation: true);
1207+
return fields.Where(f => dbFields.GetByFieldName(f.FieldName) is { });
12081208
}
12091209

12101210
/// <summary>
@@ -1226,26 +1226,8 @@ private static async ValueTask<IEnumerable<Field>> GetTargetFieldsAsync(IDbConne
12261226
{
12271227
return [];
12281228
}
1229-
var dbFields = await DbFieldCache.GetAsync(connection, tableName, transaction, cancellationToken).ConfigureAwait(false);
1230-
return GetTargetFieldsInternal(fields, dbFields, connection.GetDbSetting());
1231-
}
1232-
1233-
/// <summary>
1234-
///
1235-
/// </summary>
1236-
/// <param name="fields"></param>
1237-
/// <param name="dbFields"></param>
1238-
/// <param name="dbSetting"></param>
1239-
/// <returns></returns>
1240-
private static IEnumerable<Field> GetTargetFieldsInternal(IEnumerable<Field> fields,
1241-
DbFieldCollection dbFields,
1242-
IDbSetting dbSetting)
1243-
{
1244-
return dbFields?.IsEmpty() == false ?
1245-
fields
1246-
.Where(f =>
1247-
dbFields.GetByFieldName(f.FieldName.AsUnquoted(true, dbSetting)) != null) :
1248-
fields;
1229+
var dbFields = await DbFieldCache.GetAsync(connection, tableName, transaction, enableValidation: true, cancellationToken).ConfigureAwait(false);
1230+
return fields.Where(f => dbFields.GetByFieldName(f.FieldName) is { });
12491231
}
12501232

12511233
/// <summary>

0 commit comments

Comments
 (0)