public bool AddKeys(string value) { if (value == null) { return(false); } ReadOnlySpan <char> span = value.AsSpan(); int commaIndex = span.IndexOf(','); if (commaIndex < 0) { _first = GetKey(span); _getKey = Generators[(uint)_first]; return(_first != GroupKeys.None); } _first = GetKey(span.Slice(0, commaIndex)); if (_first == GroupKeys.None) { return(false); } _second = GetKey(span.Slice(commaIndex + 1)); _getKey = Generators[(uint)(_first | _second)]; return(_second != GroupKeys.None); }
public override void Reset() { _first = GroupKeys.None; _second = GroupKeys.None; _grouped.Clear(); _results.Clear(); base.Reset(); }
public bool Equals(GroupKeys other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(string.Equals(Key1, other.Key1) && string.Equals(Key2, other.Key2)); }
public string this[GroupKeys key] { get { switch (key) { case GroupKeys.Sex: return(SexStatus.ToNullableSexString()); case GroupKeys.Status: return(SexStatus.ToNullableStatusString()); case GroupKeys.Interests: return(StringIndexer.Interests[InterestIndex]); case GroupKeys.City: return(StringIndexer.Cities[CityIndex]); case GroupKeys.Country: return(StringIndexer.Countries[CountryIndex]); } throw new InvalidOperationException("This should never happen"); } }
private static void SerializeGroupKey(ref ParseContext stream, GroupKeys groupKey, in GroupKey group)