From fdf2cb6f8188d28e399c6cdc593eca86e70ae38d Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 8 Sep 2016 16:22:17 +0300 Subject: [PATCH] stop searching after finding 20 --- src/topics/tags.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index 50db8ccede..4d8e01b912 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -294,10 +294,13 @@ module.exports = function(Topics) { for(var i=0; i 19) { + break; + } } } - matches = matches.slice(0, 20).sort(function(a, b) { + matches = matches.sort(function(a, b) { return a > b; });