subs: Convert hidden_ids from object to Map.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-02-11 22:50:20 -08:00 committed by Tim Abbott
parent 055bcfd6e6
commit 5383f019be
1 changed files with 3 additions and 3 deletions

View File

@ -414,17 +414,17 @@ exports.filter_table = function (query) {
// If we just re-built the DOM from scratch we wouldn't need
// all this hidden/notdisplayed logic.
const hidden_ids = {};
const hidden_ids = new Set();
for (const stream_id of buckets.other) {
hidden_ids[stream_id] = true;
hidden_ids.add(stream_id);
}
for (const row of $("#subscriptions_table .stream-row")) {
const stream_id = stream_id_for_row(row);
// Below code goes away if we don't do sort-DOM-in-place.
if (hidden_ids[stream_id]) {
if (hidden_ids.has(stream_id)) {
$(row).addClass('notdisplayed');
} else {
$(row).removeClass('notdisplayed');