From 06eabbc5076a093740aaad1358785eafae944a7a Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 27 Feb 2017 17:07:17 -0500 Subject: [PATCH] typo --- src/upgrade.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/upgrade.js b/src/upgrade.js index 038f7b8389..2b4510b099 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -489,16 +489,14 @@ Upgrade.upgrade = function (callback) { require('./batch').processSortedSet('posts:pid', function (pids, next) { async.each(pids, function (pid, next) { - async.each(pids, function (pid, next) { - db.getObjectFields('post:' + pid, ['upvotes', 'downvotes'], function (err, postData) { - if (err || !postData) { - return next(err); - } + db.getObjectFields('post:' + pid, ['upvotes', 'downvotes'], function (err, postData) { + if (err || !postData) { + return next(err); + } - var votes = parseInt(postData.upvotes || 0, 10) - parseInt(postData.downvotes || 0, 10); - db.sortedSetAdd('posts:votes', votes, pid, next); - }); - }, next); + var votes = parseInt(postData.upvotes || 0, 10) - parseInt(postData.downvotes || 0, 10); + db.sortedSetAdd('posts:votes', votes, pid, next); + }); }, next); }, {}, function (err) { if (err) {