Changing offset in ReadBuffer to size_t

This commit is contained in:
Jakub Kuklis 2021-11-04 12:58:29 +00:00
parent 5e2b2b1eee
commit fa2261dee6
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ bool ReadBufferFromBlobStorage::nextImpl()
if (!initialized)
initialize();
if (static_cast<size_t>(offset) >= total_size)
if (offset >= total_size)
return false;
size_t to_read_bytes = std::min(total_size - offset, buf_size);
@ -100,7 +100,7 @@ void ReadBufferFromBlobStorage::initialize()
// TODO: is it the right way?
/// try to rewind to offset in the buffer
size_t total_read_bytes = 0;
while (total_read_bytes < static_cast<size_t>(offset))
while (total_read_bytes < offset)
{
size_t to_read_bytes = std::min(offset - total_read_bytes, buf_size);
size_t bytes_read = data_stream->Read(tmp_buffer.data(), to_read_bytes);

View File

@ -35,7 +35,7 @@ private:
std::shared_ptr<Azure::Storage::Blobs::BlobContainerClient> blob_container_client;
std::vector<uint8_t> tmp_buffer;
const String path;
off_t offset = 0;
size_t offset = 0;
size_t buf_size;
size_t total_size;
bool initialized = false;