Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion moq-transport/src/serve/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ impl StreamGroupReader {
loop {
{
let state = self.state.lock();
if self.index < state.objects.len() {
if self.index < state.objects.len() - 1 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe rearranging the inequality like if self.index + 1 < state.objects.len() { could be safer in most cases, considering that state.objects.len() can return 0.

self.index += 1;
return Ok(Some(state.objects[self.index].clone()));
}
Expand Down