Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
haiqi96 and coderabbitai[bot] authored Oct 8, 2024
1 parent e4bbd30 commit 7fc448a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions components/core/src/clp/BufferReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ BufferReader::BufferReader(char const* data, size_t data_size, size_t pos)
if (nullptr == data && (data_size != 0 || pos != 0)) {
throw OperationFailed(ErrorCode_BadParam, __FILENAME__, __LINE__);
}
else if (pos > data_size) {
throw OperationFailed(ErrorCode_BadParam, __FILENAME__, __LINE__);
}
throw OperationFailed(ErrorCode_BadParam, __FILENAME__, __LINE__);
}
}

auto BufferReader::peek_buffer(char const*& buf, size_t& peek_size) const -> void {
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/BufferedFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ BufferedFileReader::BufferedFileReader(
m_file_pos = m_file_reader->get_pos();
m_buffer_begin_pos = 0;
m_buffer_reader = BufferReader{m_buffer.data(), 0};
m_highest_read_pos = 0;
m_highest_read_pos = m_file_pos;
}

auto BufferedFileReader::try_refill_buffer_if_empty() -> ErrorCode {
Expand Down

0 comments on commit 7fc448a

Please sign in to comment.