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,
function(u) { return u.name.toLowerCase(); }
);
var modes = [
"~",
"&",
"@",
"%",
"+",
].reverse();
modes.forEach(function(mode) {
["+", "%", "@", "&", "~"].forEach(function(mode) {
this.users = _.remove(
this.users,
function(u) { return u.mode === mode; }