mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
stream_data: Fix return type of stream_info.get.
We can definitely be looking up stream ids that don't map to anything. All callers already assume it can be undefined.
This commit is contained in:
@@ -82,14 +82,14 @@ class BinaryDict<T> {
|
|||||||
yield* this.falses.values();
|
yield* this.falses.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
get(k: number): T {
|
get(k: number): T | undefined {
|
||||||
const res = this.trues.get(k);
|
const res = this.trues.get(k);
|
||||||
|
|
||||||
if (res !== undefined) {
|
if (res !== undefined) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.falses.get(k)!;
|
return this.falses.get(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
set(k: number, v: T): void {
|
set(k: number, v: T): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user