int ax = 0, dx = 0; int ad = al.nodes[ax].doc.docId, dd = dl.nodes[dx].doc.docId; int count = 0; final int alen = al.counter - 1, dlen = dl.counter - 1; while(true) { if(ad < dd) { if(ax < alen) { ++ax; ad = al.nodes[ax].doc.docId; } else break; } else if(ad > dd) { if(dx < dlen) { ++dx; dd = dl.nodes[dx].doc.docId; } else break; } else { if(dx < dlen) { ++dx; count++; dd = dl.nodes[dx].doc.docId; } else break; }
int ax = 0, dx = 0; int ad = al.nodes[ax].doc.docId, dd = dl.nodes[dx].doc.docId; int count = 0; final int alen = al.counter - 1, dlen = dl.counter - 1; while (true) { if (ad < dd) { if (ax < alen) { ++ax; ad = al.nodes[ax].doc.docId; } else break; } else if (ad > dd) { if (dx < dlen) { ++dx; dd = dl.nodes[dx].doc.docId; } else break; } else { if (dx < dlen) { ++dx; count++; dd = dl.nodes[dx].doc.docId; } else break;
	private final static void trimNodeSet(ArraySet al, ArraySet dl) {			int ax = 0, dx = 0;			int ad = al.nodes[ax].doc.docId, dd = dl.nodes[dx].doc.docId;			int count = 0;			final int alen = al.counter - 1, dlen = dl.counter - 1;			while(true) {				if(ad < dd) {					if(ax < alen) {						++ax;						ad = al.nodes[ax].doc.docId;					} else						break;				} else if(ad > dd) {					if(dx < dlen) {						++dx;						dd = dl.nodes[dx].doc.docId;					} else						break;				} else {					if(dx < dlen) {						++dx;						count++;						dd = dl.nodes[dx].doc.docId;					} else						break;				}			}			System.out.println("dl = " + dlen + "; copy = " + count);		}