mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 05:58:25 +00:00
message_list_data: Convert id_set from object to Set.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
9fa9f37521
commit
a6a19c6ace
@@ -451,16 +451,12 @@ MessageListData.prototype = {
|
|||||||
// messages that we have recently visited.
|
// messages that we have recently visited.
|
||||||
let next_msg_id = 0;
|
let next_msg_id = 0;
|
||||||
|
|
||||||
const id_set = {};
|
const id_set = new Set(msg_ids);
|
||||||
|
|
||||||
for (const msg_id of msg_ids) {
|
|
||||||
id_set[msg_id] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let idx = this.selected_idx() + 1;
|
let idx = this.selected_idx() + 1;
|
||||||
while (idx < this._items.length) {
|
while (idx < this._items.length) {
|
||||||
const msg_id = this._items[idx].id;
|
const msg_id = this._items[idx].id;
|
||||||
if (!id_set[msg_id]) {
|
if (!id_set.has(msg_id)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
next_msg_id = msg_id;
|
next_msg_id = msg_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user