Skip to content

Commit

Permalink
Checks whether it isn't null
Browse files Browse the repository at this point in the history
  • Loading branch information
xin9le committed Nov 2, 2019
1 parent 99c7930 commit fdf3154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CloudStructures/Structures/RedisHashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public async Task<bool> ContainsAsync(T value, CommandFlags flags = CommandFlags

var hashField = this.Connection.Converter.Serialize(value);
var element = await this.Connection.Database.HashGetAsync(this.Key, hashField, flags).ConfigureAwait(false);
return element.HasValue;
return !element.IsNull;
}


Expand All @@ -106,7 +106,7 @@ public async Task<Dictionary<T, bool>> ContainsAsync(IEnumerable<T> values, Comm
var elements = await this.Connection.Database.HashGetAsync(this.Key, hashFields, flags).ConfigureAwait(false);
return values
.Zip(elements, (k, v) => (key: k, value: v))
.ToDictionary(x => x.key, x => x.value.HasValue);
.ToDictionary(x => x.key, x => !x.value.IsNull);
}


Expand Down

0 comments on commit fdf3154

Please sign in to comment.