pub fn lastN(self: CircularBuffer, dist: usize) !u8 self: CircularBufferdist: usize384
385
386
387
388
389
390
391 pub fn lastN(self: CircularBuffer, dist: usize) !u8 {
if (dist > self.dict_size or dist > self.len) {
return error.CorruptInput;
}
const offset = (self.dict_size + self.cursor - dist) % self.dict_size;
return self.get(offset);
}
Retrieve the n-th last byte