Implemented some suggestions from clang-tidy (part 4) [#CLICKHOUSE-3301].

This commit is contained in:
Alexey Milovidov 2017-09-08 07:10:43 +03:00
parent d29c77adea
commit 8c9ec83a33
6 changed files with 6 additions and 8 deletions

View File

@ -52,9 +52,6 @@ struct Test
{
DB::WriteBufferFromFile wb(filename);
wb.write(reinterpret_cast<const char *>(&store), sizeof(store));
const unsigned char * p = reinterpret_cast<const unsigned char *>(&store);
for (size_t i = 0; i < sizeof(store); ++i)
++*p;
}
{

View File

@ -181,7 +181,7 @@ private:
size_t pos;
Cursor() {}
explicit Cursor(MergingBlockPtr block_, size_t pos_ = 0) : block(block_), pos(pos_) {}
explicit Cursor(const MergingBlockPtr & block_, size_t pos_ = 0) : block(block_), pos(pos_) {}
bool operator< (const Cursor & rhs) const
{

View File

@ -8,9 +8,9 @@ namespace ErrorCodes
extern const int SET_SIZE_LIMIT_EXCEEDED;
}
DistinctSortedBlockInputStream::DistinctSortedBlockInputStream(const BlockInputStreamPtr & input, const Limits & limits, size_t limit_hint_, Names columns_)
DistinctSortedBlockInputStream::DistinctSortedBlockInputStream(const BlockInputStreamPtr & input, const Limits & limits, size_t limit_hint_, const Names & columns)
: description(input->getSortDescription())
, columns_names(columns_)
, columns_names(columns)
, limit_hint(limit_hint_)
, max_rows(limits.max_rows_in_distinct)
, max_bytes(limits.max_bytes_in_distinct)

View File

@ -21,7 +21,7 @@ class DistinctSortedBlockInputStream : public IProfilingBlockInputStream
{
public:
/// Empty columns_ means all collumns.
DistinctSortedBlockInputStream(const BlockInputStreamPtr & input, const Limits & limits, size_t limit_hint_, Names columns_);
DistinctSortedBlockInputStream(const BlockInputStreamPtr & input, const Limits & limits, size_t limit_hint_, const Names & columns);
String getName() const override { return "DistinctSorted"; }

View File

@ -142,7 +142,7 @@ void IProfilingBlockInputStream::updateExtremes(Block & block)
bool IProfilingBlockInputStream::checkLimits()
{
auto handle_overflow_mode = [this] (OverflowMode mode, const String & message, int code)
auto handle_overflow_mode = [] (OverflowMode mode, const String & message, int code)
{
switch (mode)
{

View File

@ -1,3 +1,4 @@
# http://clang.llvm.org/extra/clang-tidy/
# Install latest clang with extra tools.
# Look at utils/prepare-environment/install-clang.sh