From f9edf0128004781ecf56459048eb0a38ba2fd061 Mon Sep 17 00:00:00 2001 From: Alexey Gerasimchuck Date: Tue, 5 Sep 2023 22:57:40 +0000 Subject: [PATCH] used assert_cast instead of dynamic_cast --- src/Storages/Cache/ExternalDataSourceCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Storages/Cache/ExternalDataSourceCache.cpp b/src/Storages/Cache/ExternalDataSourceCache.cpp index 1fc68a2d774..c0277d0cbbb 100644 --- a/src/Storages/Cache/ExternalDataSourceCache.cpp +++ b/src/Storages/Cache/ExternalDataSourceCache.cpp @@ -57,7 +57,7 @@ LocalFileHolder::~LocalFileHolder() { if (original_readbuffer) { - dynamic_cast(original_readbuffer.get())->seek(0, SEEK_SET); + assert_cast(original_readbuffer.get())->seek(0, SEEK_SET); file_cache_controller->value().startBackgroundDownload(std::move(original_readbuffer), *thread_pool); } } @@ -122,7 +122,7 @@ off_t RemoteReadBuffer::seek(off_t offset, int whence) { if (local_file_holder->original_readbuffer) { - auto ret = dynamic_cast(local_file_holder->original_readbuffer.get())->seek(offset, whence); + auto ret = assert_cast(local_file_holder->original_readbuffer.get())->seek(offset, whence); BufferBase::set( local_file_holder->original_readbuffer->buffer().begin(), local_file_holder->original_readbuffer->buffer().size(), @@ -147,7 +147,7 @@ off_t RemoteReadBuffer::getPosition() { if (local_file_holder->original_readbuffer) { - return dynamic_cast(local_file_holder->original_readbuffer.get())->getPosition(); + return assert_cast(local_file_holder->original_readbuffer.get())->getPosition(); } return local_file_holder->file_buffer->getPosition(); }