/// <summary>
 /// Creates a list of hashers and comparers.
 /// Notice that the number of comparers is equal to the number of hashers.
 /// Also, they must be of the same generic type.
 /// </summary>
 protected void CreateHashersAndComparers(out ExpressionComparer[] comparers, out ExpressionHasher[] hashers)
 {
     comparers = new ExpressionComparer[this.hashes.Length];
     hashers   = new ExpressionHasher[this.hashes.Length];
     for (int i = 0; i < this.hashes.Length; i++)
     {
         comparers[i] = (ExpressionComparer.Factory(this.hashes[i], true, false)); // hash, ascending, no cache.
         hashers[i]   = (ExpressionHasher.Factory(this.hashes[i]));
     }
 }
Пример #2
0
        /// <summary>
        /// Creates copies of the given comparers (the internal expressions are not copies).
        /// </summary>
        public static ExpressionComparer[] CloneHard(this ExpressionComparer[] comparers, bool cacheResults)
        {
            var newComparers = new ExpressionComparer[comparers.Length];

            for (int i = 0; i < newComparers.Length; i++)
            {
                newComparers[i] = comparers[i].Clone(cacheResults);
            }
            return(newComparers);
        }