3 * Slot indexer allows slots in both the slot buffer and the new
4 * server response to looked up in a consistent fashion.
12 int64_t firstslotseqnum;
14 SlotIndexer(Slot[] _updates, SlotBuffer _buffer) {
17 firstslotseqnum = updates[0].getSequenceNumber();
20 Slot getSlot(int64_t seqnum) {
21 if (seqnum >= firstslotseqnum) {
22 int offset = (int) (seqnum - firstslotseqnum);
23 if (offset >= updates.length)
24 throw new Error("Invalid Slot Sequence Number Reference");
26 return updates[offset];
28 return buffer.getSlot(seqnum);