From 0c416be3813a66f83df2bbd0ead223b6bfd04ec1 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 23 May 2017 04:09:47 +0300 Subject: [PATCH] More simple code; fixed translation error [#CLICKHOUSE-2]. --- dbms/src/Storages/MergeTree/ActiveDataPartSet.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/dbms/src/Storages/MergeTree/ActiveDataPartSet.h b/dbms/src/Storages/MergeTree/ActiveDataPartSet.h index 657e595614..ac93f3716f 100644 --- a/dbms/src/Storages/MergeTree/ActiveDataPartSet.h +++ b/dbms/src/Storages/MergeTree/ActiveDataPartSet.h @@ -31,24 +31,13 @@ public: bool operator<(const Part & rhs) const { - if (month != rhs.month) - return month < rhs.month; - - if (left != rhs.left) - return left < rhs.left; - if (right != rhs.right) - return right < rhs.right; - - if (level != rhs.level) - return level < rhs.level; - - return false; + return std::tie(month, left, right, level) < std::tie(rhs.month, rhs.left, rhs.right, rhs.level); } - /// Contains another part (obtained after combining another part with some other) + /// Contains another part (obtained after merging another part with some other) bool contains(const Part & rhs) const { - return month == rhs.month /// Parts for different months are not combined + return month == rhs.month /// Parts for different months are not merged && left_date <= rhs.left_date && right_date >= rhs.right_date && left <= rhs.left -- GitLab