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;
}
if (aggregation === undefined) {
if (mapConfig.isVectorOnlyMapConfig()) {
shouldAdapt = true;
} else if (this._hasAnyLayerAggregation(requestMapConfig)){
if (aggregation === undefined && mapConfig.isVectorOnlyMapConfig()) {
shouldAdapt = true;
return shouldAdapt;
}
if (aggregation === undefined && this._hasAnyLayerAggregation(requestMapConfig)){
shouldAdapt = true;
return shouldAdapt;
}
return shouldAdapt;