Skip to content

Commit

Permalink
fixed an extra result returned from next() function
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Apr 13, 2023
1 parent 7ffc56b commit cf1de99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model_breadcrumbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ class Breadcrumbs {

Location *next() { // returns pointer to next element, or null if buffer is empty
Location *ptr = nullptr;
current = (current + 1) % capacity;
if (current == head) {
// nothing returned - end of data
} else {
current = (current + 1) % capacity;
ptr = &history[current];
}
return ptr;
Expand Down

0 comments on commit cf1de99

Please sign in to comment.