コード例 #1
0
        public bool Equals(CachedFieldItem <T> xx, CachedFieldItem <T> yy)
        {
            var x = xx.Key;
            var y = yy.Key;

            if (x.HashKey != y.HashKey)
            {
                return(false);
            }

            // We are thinking it is possible to have collisions. This may not be true ever!
            if (x._index != y._index || x._store != y._store || x._termVector != y._termVector || !string.Equals(x._name, y._name))
            {
                return(false);
            }

            if (x._multipleItemsSameField.Length != y._multipleItemsSameField.Length)
            {
                return(false);
            }

            int count = x._multipleItemsSameField.Length;

            for (int i = 0; i < count; i++)
            {
                if (x._multipleItemsSameField[i] != y._multipleItemsSameField[i])
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #2
0
 public int GetHashCode(CachedFieldItem <T> obj)
 {
     return(obj.Key.HashKey);
 }