early return
This commit is contained in:
parent
384f4f74e0
commit
515e482886
@ -32,21 +32,20 @@ FilterStatsBackends.prototype.getFilterStats = function (username, unfiltered_qu
|
||||
|
||||
stats.unfiltered_rows = rows;
|
||||
|
||||
if ( filters && !_.isEmpty(filters)) {
|
||||
var analysisFilter = new AnalysisFilter(filters);
|
||||
var query = analysisFilter.sql(unfiltered_query);
|
||||
|
||||
getEstimatedRows(this.pgQueryRunner, username, query, (err, rows) => {
|
||||
if (err){
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
stats.filtered_rows = rows;
|
||||
return callback(null, stats);
|
||||
});
|
||||
|
||||
} else {
|
||||
if (!filters || _.isEmpty(filters)) {
|
||||
return callback(null, stats);
|
||||
}
|
||||
|
||||
var analysisFilter = new AnalysisFilter(filters);
|
||||
var query = analysisFilter.sql(unfiltered_query);
|
||||
|
||||
getEstimatedRows(this.pgQueryRunner, username, query, (err, rows) => {
|
||||
if (err){
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
stats.filtered_rows = rows;
|
||||
return callback(null, stats);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user