js: Convert _.find(a, …) to a.find(…).

And convert the corresponding function expressions to arrow style
while we’re here.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-07 20:31:13 -08:00
committed by Tim Abbott
parent cdd774b790
commit 336a279005
9 changed files with 16 additions and 30 deletions

View File

@@ -1156,12 +1156,12 @@ MessageListView.prototype = {
// groups are merged etc.) , but we only call this from flows
// like message editing, so it's not a big performance
// problem.
return _.find(this._message_groups, function (message_group) {
return this._message_groups.find(
// Since we don't have a way to get a message group from
// the containing message container, we just do a search
// to find it.
return message_group.message_group_id === message_group_id;
});
message_group => message_group.message_group_id === message_group_id
);
},
_rerender_header: function (message_containers) {