From 549017d035a8155332d610de62730bbce99b2be2 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Wed, 23 Oct 2013 16:27:33 -0400 Subject: [PATCH] cleaned up getCategories --- src/categories.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/categories.js b/src/categories.js index 9833720896..95baee275e 100644 --- a/src/categories.js +++ b/src/categories.js @@ -335,8 +335,6 @@ var RDB = require('./redis.js'), return; } - // var categories = []; - function getCategory(cid, callback) { Categories.getCategoryData(cid, function(err, categoryData) { if (err) { @@ -348,7 +346,6 @@ var RDB = require('./redis.js'), Categories.hasReadCategory(cid, current_user, function(hasRead) { categoryData.badgeclass = (parseInt(categoryData.topic_count, 10) === 0 || (hasRead && current_user !== 0)) ? '' : 'badge-important'; - // categories.push(categoryData); callback(null, categoryData); }); }); @@ -362,11 +359,8 @@ var RDB = require('./redis.js'), } categories = categories.filter(function(category) { - // Remove categories that have errored out - if (category) return true; - else return false; + return !!category; }).sort(function(a, b) { - // Sort categories into their defined order return parseInt(a.order, 10) - parseInt(b.order, 10); });