mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-18 21:42:55 +01:00
stop searching after finding 20
This commit is contained in:
@@ -294,10 +294,13 @@ module.exports = function(Topics) {
|
||||
for(var i=0; i<tags.length; ++i) {
|
||||
if (tags[i].toLowerCase().startsWith(data.query)) {
|
||||
matches.push(tags[i]);
|
||||
if (matches.length > 19) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matches = matches.slice(0, 20).sort(function(a, b) {
|
||||
matches = matches.sort(function(a, b) {
|
||||
return a > b;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user