From d405987a96ecf43d44ca5dc1ce79ff2a88ea6496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 12 Dec 2017 10:49:05 +0100 Subject: [PATCH] Replace nested conditional with guard clause --- .../mapconfig/adapter/aggregation-mapconfig-adapter.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js index ac7841fb..115632df 100644 --- a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js @@ -81,9 +81,15 @@ module.exports = class AggregationMapConfigAdapter { if (aggregation === 'false') { shouldAdapt = false; - } else if (aggregation === 'true') { + return shouldAdapt; + } + + if (aggregation === 'true') { shouldAdapt = true; - } else if (aggregation === undefined) { + return shouldAdapt; + } + + if (aggregation === undefined) { if (mapConfig.isVectorOnlyMapConfig()) { shouldAdapt = true; } else if (this._hasAnyLayerAggregation(requestMapConfig)){