mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
use includes instead of indexOf
use _.uniq instead of filter&indexOf
This commit is contained in:
@@ -32,9 +32,7 @@ pagination.create = function (currentPage, pageCount, queryObj) {
|
||||
pagesToShow.push(startPage + i);
|
||||
}
|
||||
|
||||
pagesToShow = pagesToShow.filter(function (page, index, array) {
|
||||
return page > 0 && page <= pageCount && array.indexOf(page) === index;
|
||||
}).sort(function (a, b) {
|
||||
pagesToShow = _.uniq(pagesToShow).filter(page => page > 0 && page <= pageCount).sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user