From ae63304392d632f926192669421c0fa0dba7c572 Mon Sep 17 00:00:00 2001 From: Xin Dong Date: Wed, 1 Jul 2020 20:23:18 -0700 Subject: [PATCH] Address Meng's comment --- fdbclient/NativeAPI.actor.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index fed9619e08..a0135d89ca 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -3692,18 +3692,8 @@ ACTOR Future getStorageMetricsLargeKeyRange(Database cx, KeyRang state StorageMetrics total; KeyRef partBegin, partEnd; for (int i = 0; i < nLocs; i++) { - if (i == 0) { - // Use the actual begin key instead of the shard begin - partBegin = keys.begin; - } else { - partBegin = locations[i].first.begin; - } - if (i == nLocs - 1) { - // Use the actual end key instead of the shard end - partEnd = keys.end; - } else { - partEnd = locations[i].first.end; - } + partBegin = (i == 0) ? keys.begin : locations[i].first.begin; + partEnd = (i == nLocs - 1) ? keys.end : locations[i].first.end; fx[i] = doGetStorageMetrics(cx, KeyRangeRef(partBegin, partEnd), locations[i].second); } wait(waitForAll(fx));