AjErl.Language.List.GetHashCode C# (CSharp) Method

GetHashCode() public method

public GetHashCode ( ) : int
return int
        public override int GetHashCode()
        {
            int result = 0;
            var list = this;

            while (list != null)
            {
                result *= 17;
                result += Machine.GetHashCode(list.Head);

                if (!(list.Tail is List))
                {
                    result *= 17;
                    result += Machine.GetHashCode(list.Tail);
                    break;
                }

                list = (List)list.Tail;
            }

            return result;
        }