Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_pill: Use Set for taken-stream membership in typeahead.

Tim Abbott0f9745326b3d
diff --git a/web/src/stream_pill.ts b/web/src/stream_pill.ts
index 17e5a27ffcb..672c6f152fc 100644
--- a/web/src/stream_pill.ts
+++ b/web/src/stream_pill.ts
@@ -120,8 +120,8 @@ export function filter_taken_streams(
items: StreamSubscription[],
pill_widget: StreamPillWidget | CombinedPillContainer,
): StreamSubscription[] {
- const taken_stream_ids = get_stream_ids(pill_widget);
- items = items.filter((item) => !taken_stream_ids.includes(item.stream_id));
+ const taken_stream_ids = new Set(get_stream_ids(pill_widget));
+ items = items.filter((item) => !taken_stream_ids.has(item.stream_id));
return items;
}