···2929 self.write_index = (self.write_index + 1) % capacity;
3030 }
31313232- /// Get a reference to the value being pointed by the read index
3232+ pub fn isEmpty(self: *const Self) bool {
3333+ return self.read_index == self.write_index;
3434+ }
3535+3636+ /// Get a pointer to the value being pointed by the read index
3337 pub fn get(self: *Self) ?*T {
3434- if (self.read_index == self.write_index) {
3838+ if (self.isEmpty()) {
3539 return null;
3640 }
3741···41454246 /// Remove the value being pointed by the read index, returning the value
4347 pub fn read(self: *Self) ?T {
4444- if (self.read_index == self.write_index) {
4848+ if (self.isEmpty()) {
4549 return null;
4650 }
4751