public int GetHashCode(Uri obj) { if (!obj.IsAbsoluteUri) { return(obj.GetHashCode()); } StringSegment resolvedFragment = ResolveFragment(obj); if (resolvedFragment.IsEmpty) { return(obj.GetHashCode()); } return(obj.GetHashCode() ^ resolvedFragment.GetHashCode()); }
public override int GetHashCode() { Contract.Assert(_name != null); var nameHashCode = StringSegmentComparer.OrdinalIgnoreCase.GetHashCode(_name); if (!StringSegment.IsNullOrEmpty(_value)) { // If we have a quoted-string, then just use the hash code. If we have a token, convert to lowercase // and retrieve the hash code. if (_value[0] == '"') { return(nameHashCode ^ _value.GetHashCode()); } return(nameHashCode ^ StringSegmentComparer.OrdinalIgnoreCase.GetHashCode(_value)); } return(nameHashCode); }
public override int GetHashCode() { // Since the tag is a quoted-string we treat it case-sensitive. return(_tag.GetHashCode() ^ _isWeak.GetHashCode()); }
/// <inheritdoc /> public override int GetHashCode() { return(_name.GetHashCode() ^ _value.GetHashCode()); }
public override int GetHashCode() { unchecked { return((_formatting.GetHashCode() * 397) ^ _data.GetHashCode()); } }
public override int GetHashCode() => _segment.GetHashCode();