Esempio n. 1
0
 public bool EqualsStringView(StringView v)
 {
     return(GetHashCodeUint() == v.GetHashCodeUint());
 }
Esempio n. 2
0
File: ID.cs Progetto: dadebert/Semi
 /// <summary>
 /// Serves as a hash function for a <see cref="T:Semi.ID"/> object.
 /// It is very important to note that `DefaultNamespace` does not
 /// participate in the hashing process (i.e. whatever value it has,
 /// `ID`s with otherwise equal fields will yield the same hash).
 /// Unresolved contextual IDs have no way to retrieve context in this
 /// method and therefore two instances of `@:abc` will hash to the
 /// same value, even if the intention was for them to resolve to two
 /// different namespaces. Expand the context with
 /// <see cref="WithContextNamespace"/> before calling this method.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.</returns>
 public override int GetHashCode()
 {
     return((int)(Namespace.GetHashCodeUint() ^ Name.GetHashCodeUint()));
 }