private Address getNextAddr(Address addr, CodeUnit cu) {
		if (cu == null) {
			return addrIt.next();
		}
		if (forward) {
			Address end = cu.getMaxAddress();
			while (addr != null && addr.compareTo(end) <= 0) {
				addr = addrIt.next();
			}
		}
		else {
			Address start = cu.getMinAddress();
			while (addr != null && addr.compareTo(start) >= 0) {
				addr = addrIt.next();
			}
		}
		return addr;
	}
Constructs a new CodeUnitRecordIterator
@param codeMgr the code manager
@param instIt the instruction iterator
@param dataIt the data iterator
@param set the address set (required)
@param forward the iterator direction
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/code/CodeUnitRecordIterator.java