From a6a19c6acee302fe67bb2ab8e510c1136f4b7a8a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 11 Feb 2020 21:36:52 -0800 Subject: [PATCH] message_list_data: Convert id_set from object to Set. Signed-off-by: Anders Kaseorg --- static/js/message_list_data.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/static/js/message_list_data.js b/static/js/message_list_data.js index d963515b69..aac8d80f64 100644 --- a/static/js/message_list_data.js +++ b/static/js/message_list_data.js @@ -451,16 +451,12 @@ MessageListData.prototype = { // messages that we have recently visited. let next_msg_id = 0; - const id_set = {}; - - for (const msg_id of msg_ids) { - id_set[msg_id] = true; - } + const id_set = new Set(msg_ids); let idx = this.selected_idx() + 1; while (idx < this._items.length) { const msg_id = this._items[idx].id; - if (!id_set[msg_id]) { + if (!id_set.has(msg_id)) { break; } next_msg_id = msg_id;