diff --git a/src/topics/tags.js b/src/topics/tags.js index 8e4b85bddf..a3d3738a02 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -116,9 +116,11 @@ module.exports = function(Topics) { db.delete('topic:' + tid + ':tags', next); }, function(next) { - async.each(tags, function(tag, next) { - db.sortedSetRemove('tag:' + tag + ':topics', tid, next); - }, next); + var sets = tags.map(function(tag) { + return 'tag:' + tag + ':topics'; + }); + + db.sortedSetsRemove(sets, tid, next); } ], callback); });