Remove unnecessary operation when sorting users

This commit is contained in:
Jérémie Astori 2016-03-14 01:44:03 -04:00
parent f81235900b
commit d02c0bd72c

View File

@ -27,14 +27,8 @@ Chan.prototype.sortUsers = function() {
this.users, this.users,
function(u) { return u.name.toLowerCase(); } function(u) { return u.name.toLowerCase(); }
); );
var modes = [
"~", ["+", "%", "@", "&", "~"].forEach(function(mode) {
"&",
"@",
"%",
"+",
].reverse();
modes.forEach(function(mode) {
this.users = _.remove( this.users = _.remove(
this.users, this.users,
function(u) { return u.mode === mode; } function(u) { return u.mode === mode; }