private int ArraysHashCode(Term[] termArray) { if (termArray == null) return 0; int result = 1; for (int i = 0; i < termArray.Length; i++) { Term term = termArray[i]; result = 31 * result + (term == null?0:term.GetHashCode()); } return result; }