From 5d8435c07989e281535ab6e24ed784dc5fa91cf0 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 23 Apr 2014 02:58:05 +0400 Subject: [PATCH] dbms: tiny improvement [#METR-10931]. --- .../DB/Storages/MergeTree/MergeTreeBlockInputStream.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbms/include/DB/Storages/MergeTree/MergeTreeBlockInputStream.h b/dbms/include/DB/Storages/MergeTree/MergeTreeBlockInputStream.h index fc865bda387..803b595bfe9 100644 --- a/dbms/include/DB/Storages/MergeTree/MergeTreeBlockInputStream.h +++ b/dbms/include/DB/Storages/MergeTree/MergeTreeBlockInputStream.h @@ -85,9 +85,9 @@ protected: if (!reader) { UncompressedCache * uncompressed_cache = use_uncompressed_cache ? storage.context.getUncompressedCache() : NULL; - reader = new MergeTreeReader(path, column_names, uncompressed_cache, storage); + reader.reset(new MergeTreeReader(path, column_names, uncompressed_cache, storage)); if (prewhere_actions) - pre_reader = new MergeTreeReader(path, pre_column_names, uncompressed_cache, storage); + pre_reader.reset(new MergeTreeReader(path, pre_column_names, uncompressed_cache, storage)); } if (prewhere_actions) @@ -245,7 +245,7 @@ protected: * Чтобы при создании многих источников, но одновременном чтении только из нескольких, * буферы не висели в памяти. */ - reader = nullptr; + reader.reset(); } return res; @@ -263,8 +263,8 @@ private: MarkRanges remaining_mark_ranges; /// В каких диапазонах засечек еще не прочли. /// В порядке убывания номеров, чтобы можно было выбрасывать из конца. bool use_uncompressed_cache; - Poco::SharedPtr reader; - Poco::SharedPtr pre_reader; + std::unique_ptr reader; + std::unique_ptr pre_reader; ExpressionActionsPtr prewhere_actions; String prewhere_column; bool remove_prewhere_column;