Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
shacharPash committed Sep 11, 2023
1 parent c01f7ee commit 3b90ba0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/NRedisStack/Graph/DataTypes/Edge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 4 additions & 4 deletions src/NRedisStack/Search/AggregationResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ 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];

_results = new Dictionary<string, RedisValue>[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<string, RedisValue>();
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?)
Expand All @@ -36,7 +36,7 @@ internal AggregationResult(RedisResult result, long cursorId = -1)
}
public IReadOnlyList<Dictionary<string, RedisValue>> GetResults() => _results;

public Dictionary<string, RedisValue> this[int index]
public Dictionary<string, RedisValue>? this[int index]
=> index >= _results.Length ? null : _results[index];

public Row GetRow(int index)
Expand Down

0 comments on commit 3b90ba0

Please sign in to comment.