Skip to content

Commit 1b4359c

Browse files
committed
Remove extra ready_for_next_batch field
1 parent 2699453 commit 1b4359c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

getdents/_getdents.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct getdents_state {
2424
int fd;
2525
int nread;
2626
size_t buff_size;
27-
bool ready_for_next_batch;
2827
};
2928

3029

@@ -76,7 +75,6 @@ getdents_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7675
state->fd = fd;
7776
state->bpos = 0;
7877
state->nread = 0;
79-
state->ready_for_next_batch = true;
8078
return (PyObject *) state;
8179
}
8280

@@ -90,9 +88,7 @@ getdents_dealloc(struct getdents_state *state)
9088
static PyObject *
9189
getdents_next(struct getdents_state *s)
9290
{
93-
s->ready_for_next_batch = s->bpos >= s->nread;
94-
95-
if (s->ready_for_next_batch) {
91+
if (s->bpos >= s->nread) {
9692
s->bpos = 0;
9793
s->nread = syscall(SYS_getdents64, s->fd, s->buff, s->buff_size);
9894

0 commit comments

Comments
 (0)