Replace nested conditional with guard clause

This commit is contained in:
Daniel García Aubert 2017-12-12 10:56:23 +01:00
parent d405987a96
commit c637caf9c9

View File

@ -89,12 +89,14 @@ module.exports = class AggregationMapConfigAdapter {
return shouldAdapt; return shouldAdapt;
} }
if (aggregation === undefined) { if (aggregation === undefined && mapConfig.isVectorOnlyMapConfig()) {
if (mapConfig.isVectorOnlyMapConfig()) { shouldAdapt = true;
shouldAdapt = true; return shouldAdapt;
} else if (this._hasAnyLayerAggregation(requestMapConfig)){ }
shouldAdapt = true;
} if (aggregation === undefined && this._hasAnyLayerAggregation(requestMapConfig)){
shouldAdapt = true;
return shouldAdapt;
} }
return shouldAdapt; return shouldAdapt;