remove some more parseInts

This commit is contained in:
Barış Soner Uşaklı
2018-10-22 21:58:34 -04:00
parent 7a44424214
commit c738dc7d3e
9 changed files with 54 additions and 59 deletions

View File

@@ -101,9 +101,7 @@ module.exports = function (Categories) {
}
},
function (normalTids, next) {
normalTids = normalTids.filter(function (tid) {
return !pinnedTids.includes(tid);
});
normalTids = normalTids.filter(tid => !pinnedTids.includes(tid));
next(null, pinnedTids.concat(normalTids));
},
@@ -150,9 +148,7 @@ module.exports = function (Categories) {
if (data.tag) {
if (Array.isArray(data.tag)) {
set = [set].concat(data.tag.map(function (tag) {
return 'tag:' + tag + ':topics';
}));
set = [set].concat(data.tag.map(tag => 'tag:' + tag + ':topics'));
} else {
set = [set, 'tag:' + data.tag + ':topics'];
}
@@ -225,7 +221,7 @@ module.exports = function (Categories) {
db.incrObjectField('category:' + cid, 'post_count', next);
},
function (next) {
if (parseInt(pinned, 10) === 1) {
if (pinned) {
return setImmediate(next);
}