rows: Convert valid_table_names from object to Set.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-05-26 19:04:54 -07:00 committed by Tim Abbott
parent aa912ef759
commit e6dd1911c7
1 changed files with 5 additions and 5 deletions

View File

@ -111,13 +111,13 @@ exports.local_echo_id = function (message_row) {
return zid;
};
const valid_table_names = {
zhome: true,
zfilt: true,
};
const valid_table_names = new Set([
"zhome",
"zfilt",
]);
exports.get_table = function (table_name) {
if (!valid_table_names.hasOwnProperty(table_name)) {
if (!valid_table_names.has(table_name)) {
return $();
}