Skip to content

Commit 7ede033

Browse files
committed
[line_buffer] remove erroneous got_preload check that could cause a short read
1 parent 68f51de commit 7ede033

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/line_buffer.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ line_buffer::fill_range(file_off_t start,
820820
scan_direction dir)
821821
{
822822
auto retval = false;
823-
auto got_preload = false;
824823

825824
require(start >= 0);
826825

@@ -871,11 +870,9 @@ line_buffer::fill_range(file_off_t start,
871870
this->lb_stats.s_used_preloads += 1;
872871
this->lb_next_line_start_index = 0;
873872
this->lb_next_buffer_offset = 0;
874-
got_preload = true;
875873
}
876874
if (this->in_range(start)
877-
&& (got_preload || max_length == 0
878-
|| this->in_range(start + max_length - 1)))
875+
&& (max_length == 0 || this->in_range(start + max_length - 1)))
879876
{
880877
// log_debug("fd(%d) cached!", this->lb_fd.get());
881878
/* Cache already has the data, nothing to do. */

0 commit comments

Comments
 (0)