From 3b90ba0bc00de5dab77cf466a2ce45a643924e8c Mon Sep 17 00:00:00 2001 From: shacharPash Date: Mon, 11 Sep 2023 16:58:28 +0300 Subject: [PATCH] more --- src/NRedisStack/Graph/DataTypes/Edge.cs | 2 +- src/NRedisStack/Search/AggregationResult.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NRedisStack/Graph/DataTypes/Edge.cs b/src/NRedisStack/Graph/DataTypes/Edge.cs index 30308787..cf005f5c 100644 --- a/src/NRedisStack/Graph/DataTypes/Edge.cs +++ b/src/NRedisStack/Graph/DataTypes/Edge.cs @@ -66,7 +66,7 @@ public override int GetHashCode() int hash = 17; hash = hash * 31 + base.GetHashCode(); - hash = hash * 31 + RelationshipType.GetHashCode(); + hash = hash * 31 + RelationshipType!.GetHashCode(); hash = hash * 31 + Source.GetHashCode(); hash = hash * 31 + Destination.GetHashCode(); diff --git a/src/NRedisStack/Search/AggregationResult.cs b/src/NRedisStack/Search/AggregationResult.cs index 70c2dffb..b8e4d38e 100644 --- a/src/NRedisStack/Search/AggregationResult.cs +++ b/src/NRedisStack/Search/AggregationResult.cs @@ -11,7 +11,7 @@ public sealed class AggregationResult internal AggregationResult(RedisResult result, long cursorId = -1) { - var arr = (RedisResult[])result; + var arr = (RedisResult[])result!; // the first element is always the number of results TotalResults = (long)arr[0]; @@ -19,11 +19,11 @@ internal AggregationResult(RedisResult result, long cursorId = -1) _results = new Dictionary[arr.Length - 1]; for (int i = 1; i < arr.Length; i++) { - var raw = (RedisResult[])arr[i]; + var raw = (RedisResult[])arr[i]!; var cur = new Dictionary(); for (int j = 0; j < raw.Length;) { - var key = (string)raw[j++]; + var key = (string)raw[j++]!; var val = raw[j++]; if (val.Type == ResultType.MultiBulk) continue; // TODO: handle multi-bulk (maybe change to object?) @@ -36,7 +36,7 @@ internal AggregationResult(RedisResult result, long cursorId = -1) } public IReadOnlyList> GetResults() => _results; - public Dictionary this[int index] + public Dictionary? this[int index] => index >= _results.Length ? null : _results[index]; public Row GetRow(int index)