From 3044c3ff787a087f633f90f2955f52b502913540 Mon Sep 17 00:00:00 2001 From: XmasApple Date: Sat, 2 Sep 2023 13:42:14 +0300 Subject: [PATCH] Fix warnings --- .github/workflows/lint.yml | 30 +++++++++++++++++++++++++++++- src/Ydb.Sdk/src/Value/ResultSet.cs | 7 +++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e416e98b..0c1c484d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,4 +49,32 @@ jobs: include: | **.cs **.cshtml - ignoreIssueType: UnusedField.Compiler,UnusedVariable.Compiler,UnusedAutoPropertyAccessor.Global,UnusedAnonymousMethodSignature,UnusedNullableDirective,UnusedTupleComponentInReturnValue,UnusedLocalFunction.Compiler,UnusedLocalFunctionReturnValue,UnusedMethodReturnValue.Global,UnusedType.Global,UnusedMemberInSuper.Global,UnusedMember.Global,UnusedMemberHierarchy.Global,UnusedLabel,UnusedVariable,UnusedParameter.Global,UnusedParameterInPartialMethod,UnusedPositionalParameterCompiler,UnusedTypeParameter,NotAccessedField.Compiler,NotAccessedVariable.Compiler,NotAccessedField.Global,NotAccessedPositionalProperty.Global,NotAccessedVariable,NotAccessedOutParameterVariable,NotAccessedPrimaryConstructorParameterCompiler,InconsistentNaming,CollectionNeverUpdated.Global + ignoreIssueType: | + UnusedField.Compiler, + UnusedVariable.Compiler, + UnusedAutoPropertyAccessor.Global, + UnusedAnonymousMethodSignature, + UnusedNullableDirective, + UnusedTupleComponentInReturnValue, + UnusedLocalFunction.Compiler, + UnusedLocalFunctionReturnValue, + UnusedMethodReturnValue.Global, + UnusedType.Global, + UnusedMemberInSuper.Global, + UnusedMember.Global, + UnusedMemberHierarchy.Global, + UnusedLabel, + UnusedVariable, + UnusedParameter.Global, + UnusedParameterInPartialMethod, + UnusedPositionalParameterCompiler, + UnusedTypeParameter, + NotAccessedField.Compiler, + NotAccessedVariable.Compiler, + NotAccessedField.Global, + NotAccessedPositionalProperty.Global, + NotAccessedVariable, + NotAccessedOutParameterVariable, + NotAccessedPrimaryConstructorParameterCompiler, + InconsistentNaming, + CollectionNeverUpdated.Global diff --git a/src/Ydb.Sdk/src/Value/ResultSet.cs b/src/Ydb.Sdk/src/Value/ResultSet.cs index 1583534d..c67efd24 100644 --- a/src/Ydb.Sdk/src/Value/ResultSet.cs +++ b/src/Ydb.Sdk/src/Value/ResultSet.cs @@ -5,7 +5,6 @@ namespace Ydb.Sdk.Value; public class ResultSet { - private readonly IReadOnlyDictionary _columnsMap; public IReadOnlyList Columns { get; } public IReadOnlyList Rows { get; } public bool Truncated { get; } @@ -14,11 +13,11 @@ internal ResultSet(Ydb.ResultSet resultSetProto) { Columns = resultSetProto.Columns.Select(c => new Column(c.Type, c.Name)).ToList(); - _columnsMap = Columns + var columnsMap = Columns .Select((c, idx) => (c.Name, Index: idx)) .ToDictionary(t => t.Name, t => t.Index); - Rows = new RowsList(resultSetProto.Rows, Columns, _columnsMap); + Rows = new RowsList(resultSetProto.Rows, Columns, columnsMap); Truncated = resultSetProto.Truncated; } @@ -95,7 +94,7 @@ internal Enumerator( public Row Current => CurrentRow; - object? IEnumerator.Current => CurrentRow; + object IEnumerator.Current => CurrentRow; public void Dispose() {