AjErl.Language.List.GetHashCode C# (CSharp) 메소드

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 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;
        }