internal SortedSetEntry?RetrieveEntryByHashCode(int hashCode) { foreach (var val in EnumerateValues()) { if (RedisValueHashCode.GetStableHashCode(val.Item2.Element) == hashCode) { return(val.Item2); } } return(null); }
//Remove entries given a hash code internal void RemoveByHashCode(string key, string[] hashCodes) { var set = GetSet(key); if (set != null) { //Get the items for the supplied hash codes foreach (var hashCode in hashCodes) { var value = set.FirstOrDefault(v => RedisValueHashCode.GetStableHashCode(v).ToString() == hashCode); if (value != default(RedisValue)) { set.Remove(value); } } } }
internal bool RemoveByHashCode(int hashCode) { return(_sortedSet.RemoveWhere(e => RedisValueHashCode.GetStableHashCode(e.Element) == hashCode) >= 0); }