Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
XmasApple committed Sep 2, 2023
1 parent 5ac2c92 commit 3044c3f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions src/Ydb.Sdk/src/Value/ResultSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace Ydb.Sdk.Value;

public class ResultSet
{
private readonly IReadOnlyDictionary<string, int> _columnsMap;
public IReadOnlyList<Column> Columns { get; }
public IReadOnlyList<Row> Rows { get; }
public bool Truncated { get; }
Expand All @@ -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;
}

Expand Down Expand Up @@ -95,7 +94,7 @@ internal Enumerator(

public Row Current => CurrentRow;

object? IEnumerator.Current => CurrentRow;
object IEnumerator.Current => CurrentRow;

public void Dispose()
{
Expand Down

0 comments on commit 3044c3f

Please sign in to comment.