Microsoft.CodeAnalysis.Sarif.MultiplyByPrimesHash.Add C# (CSharp) Method

Add() public method

Adds item to the calculated hash.
public Add ( int item ) : void
item int The item to add to the calculated hash.
return void
        public void Add(int item)
        {
            _state = unchecked((_state * 31) + item);
        }

Same methods

MultiplyByPrimesHash::Add ( object item ) : void

Usage Example

Esempio n. 1
0
        /// <summary>Returns a hash code for this object.</summary>
        /// <returns>A hash code for this object.</returns>
        public override int GetHashCode()
        {
            var hash = new MultiplyByPrimesHash();

            hash.Add(this.LineNumber);
            hash.Add(this.ColumnNumber);
            return(hash.GetHashCode());
        }