Merge pull request #193 from thelounge/astorije/minor-simplification
Remove unnecessary operation when sorting users
This commit is contained in:
commit
e54409b3dd
@ -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; }
|
||||||
|
Loading…
Reference in New Issue
Block a user