removed ternary operator to make if statement clearer

Этот коммит содержится в:
JoramWilander
2015-07-30 08:33:52 -04:00
родитель 7bc5f4e863
Коммит 0c627913f7

Просмотреть файл

@@ -285,7 +285,10 @@ module.exports.getPosts = function(force, id, maxPosts) {
// if we already have more than POST_CHUNK_SIZE posts,
// let's get the amount we have but rounded up to next multiple of POST_CHUNK_SIZE,
// with a max at maxPosts
var numPosts = post_list && post_list.order.length > 0 ? Math.min(maxPosts, Constants.POST_CHUNK_SIZE * Math.ceil(post_list.order.length / Constants.POST_CHUNK_SIZE)) : Constants.POST_CHUNK_SIZE;
var numPosts = Math.min(maxPosts, Constants.POST_CHUNK_SIZE);
if (post_list && post_list.order.length > 0) {
numPosts = Math.min(maxPosts, Constants.POST_CHUNK_SIZE * Math.ceil(post_list.order.length / Constants.POST_CHUNK_SIZE));
}
if (channelId != null) {
callTracker["getPosts_"+channelId] = utils.getTimestamp();