public TermData add(TermData t1, TermData t2) {if (t1 == NO_OUTPUT) {return t2;} else if (t2 == NO_OUTPUT) {return t1;}TermData ret;if (t2.bytes != null || t2.docFreq > 0) {ret = new TermData(t2.bytes, t2.docFreq, t2.totalTermFreq);} else {ret = new TermData(t1.bytes, t1.docFreq, t1.totalTermFreq);}return ret;}
public override TermData Add(TermData t1, TermData t2){if (Equals(t1, NO_OUTPUT))return t2;if (Equals(t2, NO_OUTPUT))return t1;Debug.Assert(t1.longs.Length == t2.longs.Length);var pos = 0;var accum = new long[_longsSize];while (pos < _longsSize){accum[pos] = t1.longs[pos] + t2.longs[pos];pos++;}TermData ret;if (t2.bytes != null || t2.docFreq > 0){ret = new TermData(accum, t2.bytes, t2.docFreq, t2.totalTermFreq);}else{ret = new TermData(accum, t1.bytes, t1.docFreq, t1.totalTermFreq);}return ret;}