Fix plane_it_t skipping the last entry when iterating
This commit is contained in:
parent
35b785ebb8
commit
df2d728af7
1 changed files with 8 additions and 5 deletions
|
|
@ -186,14 +186,14 @@ namespace platf {
|
|||
public:
|
||||
plane_it_t(int fd, std::uint32_t *plane_p, std::uint32_t *end):
|
||||
fd { fd }, plane_p { plane_p }, end { end } {
|
||||
inc();
|
||||
load_next_valid_plane();
|
||||
}
|
||||
|
||||
plane_it_t(int fd, std::uint32_t *end):
|
||||
fd { fd }, plane_p { end }, end { end } {}
|
||||
|
||||
void
|
||||
inc() {
|
||||
load_next_valid_plane() {
|
||||
this->plane.reset();
|
||||
|
||||
for (; plane_p != end; ++plane_p) {
|
||||
|
|
@ -204,13 +204,16 @@ namespace platf {
|
|||
}
|
||||
|
||||
this->plane = util::make_shared<plane_t>(plane.release());
|
||||
|
||||
// One last increment
|
||||
++plane_p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
inc() {
|
||||
++plane_p;
|
||||
load_next_valid_plane();
|
||||
}
|
||||
|
||||
bool
|
||||
eq(const plane_it_t &other) const {
|
||||
return plane_p == other.plane_p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue