Remove local variable

This commit is contained in:
Daniel García Aubert 2017-12-18 18:55:32 +01:00
parent 6638ba91c3
commit 800870e783

View File

@ -101,10 +101,8 @@ module.exports = class AggregationMapConfigAdapter {
}
_shouldAdaptLayer (connection, mapConfig, layer, index, callback) {
let shouldAdapt = false;
if (!mapConfig.isAggregationLayer(index)) {
return callback(null, shouldAdapt);
return callback(null, false);
}
const aggregationMetadata = queryUtils.getAggregationMetadata({
@ -113,22 +111,22 @@ module.exports = class AggregationMapConfigAdapter {
connection.query(aggregationMetadata, (err, res) => {
if (err) {
return callback(null, shouldAdapt);
return callback(null, false);
}
const result = res.rows[0] || {};
if (!mapConfig.doesLayerReachThreshold(index, result.count)) {
return callback(null, shouldAdapt);
return callback(null, false);
}
if (!AggregationMapConfig.supportsGeometryType(result.type)) {
return callback(new Error(unsupportedGeometryTypeErrorMessage({ geometryType: result.type })));
return callback(new Error(unsupportedGeometryTypeErrorMessage({
geometryType: result.type
})));
}
shouldAdapt = true;
callback(null, shouldAdapt);
callback(null, true);
});
}