Merge pull request #631 from JustinBeckwith/union

refactor: drop usage of _.union
This commit is contained in:
Michael Lumish 2018-11-15 15:02:15 -08:00 committed by GitHub
commit 43a95f98bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -751,7 +751,7 @@ function _startBatchIfReady(call, batch, batch_state, callback) {
// Dependencies are met, start the batch and any deferred batches whose // Dependencies are met, start the batch and any deferred batches whose
// dependencies are met as a result. // dependencies are met as a result.
call.startBatch(batch, callback); call.startBatch(batch, callback);
completed_ops = _.union(completed_ops, batch_ops); completed_ops = Array.from(new Set(completed_ops.concat(batch_ops)));
deferred_batches = _.flatMap(deferred_batches, function(deferred_batch) { deferred_batches = _.flatMap(deferred_batches, function(deferred_batch) {
var deferred_batch_ops = Object.keys(deferred_batch).map(Number); var deferred_batch_ops = Object.keys(deferred_batch).map(Number);
if (_areBatchRequirementsMet(deferred_batch_ops, completed_ops)) { if (_areBatchRequirementsMet(deferred_batch_ops, completed_ops)) {