refactor
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...

This commit is contained in:
2024-12-27 17:30:30 -06:00
parent 8b36a007b6
commit b04f903e4d
2 changed files with 13 additions and 13 deletions

View File

@@ -32,15 +32,15 @@ auto direct_open_file::on_check_start() -> bool {
return (get_file_size() == 0U || has_reader_thread());
}
auto direct_open_file::use_buffer(
std::size_t chunk,
std::function<api_error(const data_buffer &data)> func) -> api_error {
return func(ring_data_.at(chunk % get_read_state_size()));
}
auto direct_open_file::handle_read_buffer(
std::size_t chunk,
std::function<api_error(data_buffer &data)> func) -> api_error {
return func(ring_data_.at(chunk % get_read_state_size()));
}
auto direct_open_file::use_buffer(
std::size_t chunk,
std::function<api_error(const data_buffer &data)> func) -> api_error {
return func(ring_data_.at(chunk % get_read_state_size()));
}
} // namespace repertory

View File

@@ -103,6 +103,13 @@ void ring_buffer_open_file::on_destroy() {
utils::get_last_error_code(), "failed to delete file");
}
auto ring_buffer_open_file::handle_read_buffer(
std::size_t /* chunk */,
std::function<api_error(data_buffer &data)> func) -> api_error {
data_buffer buffer;
return func(buffer);
}
auto ring_buffer_open_file::use_buffer(
std::size_t chunk,
std::function<api_error(const data_buffer &data)> func) -> api_error {
@@ -125,11 +132,4 @@ auto ring_buffer_open_file::use_buffer(
return func(buffer);
}
auto ring_buffer_open_file::handle_read_buffer(
std::size_t /* chunk */,
std::function<api_error(data_buffer &data)> func) -> api_error {
data_buffer buffer;
return func(buffer);
}
} // namespace repertory