kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [4/4] kudu git commit: build: don't use constexpr lambdas
Date Wed, 21 Nov 2018 03:29:42 GMT
build: don't use constexpr lambdas

We use constexpr lambdas, and some compilers are fine with it.
Officially, they aren't supported until C++17, so this patch replaces
such instances with const lambdas.

This would yield a build failure in some environments.

See https://en.cppreference.com/w/cpp/language/lambda for more details
about constexpr lambdas in C++17.

Change-Id: I9d1bdb84d9e6ee5c6a4a920d46f5daee68975208
Reviewed-on: http://gerrit.cloudera.org:8080/11970
Reviewed-by: Adar Dembo <adar@cloudera.com>
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/66b06de7
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/66b06de7
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/66b06de7

Branch: refs/heads/master
Commit: 66b06de7b14621f821141ac7f9ec4ba96cad5af1
Parents: 7437626
Author: Andrew Wong <awong@cloudera.com>
Authored: Tue Nov 20 16:37:30 2018 -0800
Committer: Andrew Wong <awong@cloudera.com>
Committed: Wed Nov 21 01:41:57 2018 +0000

----------------------------------------------------------------------
 src/kudu/tablet/compaction_policy.cc   | 2 +-
 src/kudu/tools/rebalance_algo-test.cc  | 4 ++--
 src/kudu/tserver/tablet_server-test.cc | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/66b06de7/src/kudu/tablet/compaction_policy.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/compaction_policy.cc b/src/kudu/tablet/compaction_policy.cc
index 54350eb..6dee57c 100644
--- a/src/kudu/tablet/compaction_policy.cc
+++ b/src/kudu/tablet/compaction_policy.cc
@@ -158,7 +158,7 @@ class BoundCalculator {
       return;
     }
 
-    constexpr auto compareByDescendingDensity =
+    const auto compareByDescendingDensity =
         [](const RowSetInfo* a, const RowSetInfo* b) {
           return a->density() > b->density();
         };

http://git-wip-us.apache.org/repos/asf/kudu/blob/66b06de7/src/kudu/tools/rebalance_algo-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/rebalance_algo-test.cc b/src/kudu/tools/rebalance_algo-test.cc
index 6a5e5a8..092ac4d 100644
--- a/src/kudu/tools/rebalance_algo-test.cc
+++ b/src/kudu/tools/rebalance_algo-test.cc
@@ -235,8 +235,8 @@ void VerifyLocationRebalancingMoves(const TestClusterConfig& cfg)
{
         // Here it's necessary to normalize both the reference and the actual
         // results before performing element-to-element comparison.
         vector<TableReplicaMove> ref_moves(cfg.expected_moves);
-        constexpr auto kMovesComparator = [](const TableReplicaMove& lhs,
-                                             const TableReplicaMove& rhs) {
+        const auto kMovesComparator = [](const TableReplicaMove& lhs,
+                                         const TableReplicaMove& rhs) {
           if (lhs.table_id != rhs.table_id) {
             return lhs.table_id < rhs.table_id;
           }

http://git-wip-us.apache.org/repos/asf/kudu/blob/66b06de7/src/kudu/tserver/tablet_server-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test.cc b/src/kudu/tserver/tablet_server-test.cc
index a12e99b..bfdd7ab 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -3434,7 +3434,7 @@ TEST_F(TabletServerTest, TestScannerCheckMatchingUser) {
     checksum_val = checksum_resp.checksum();
   }
 
-  constexpr auto verify_authz_error = [] (const Status& s) {
+  const auto verify_authz_error = [] (const Status& s) {
     EXPECT_TRUE(s.IsRemoteError()) << s.ToString();
     ASSERT_STR_CONTAINS(s.ToString(), "Not authorized");
   };


Mime
View raw message