Merge pull request #193 from thelounge/astorije/minor-simplification

Remove unnecessary operation when sorting users
This commit is contained in:
Max-P 2016-03-14 20:55:49 -04:00
commit e54409b3dd

View File

@ -28,14 +28,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; }