public void Add(StyleVariable sv) { int hashCode = sv.GetHashCode(); int num = this.m_SortedHash.BinarySearch(hashCode); bool flag = num >= 0; if (!flag) { this.m_SortedHash.Insert(~num, hashCode); this.m_Variables.Add(sv); this.m_VariableHash = ((this.m_Variables.Count == 0) ? sv.GetHashCode() : (this.m_VariableHash * 397 ^ sv.GetHashCode())); } }
public void Add(StyleVariable sv) { m_Variables.Add(sv); unchecked { m_VariableHash = m_Variables.Count == 0 ? sv.GetHashCode() : (m_VariableHash * 397) ^ sv.GetHashCode(); } }
public void Add(StyleVariable sv) { // Avoid duplicates. Otherwise the variable context explodes as hierarchy gets deeper. var hash = sv.GetHashCode(); var hashIndex = m_SortedHash.BinarySearch(hash); if (hashIndex >= 0) { return; } m_SortedHash.Insert(~hashIndex, hash); m_Variables.Add(sv); unchecked { m_VariableHash = m_Variables.Count == 0 ? sv.GetHashCode() : (m_VariableHash * 397) ^ sv.GetHashCode(); } }