mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
lazy_set: Move the size getter above other methods.
This is to avoid @typescript-eslint/member-ordering error when this module is converted to typescript.
This commit is contained in:
committed by
Tim Abbott
parent
16a3d444fd
commit
84958bf7eb
@@ -30,6 +30,15 @@ export class LazySet {
|
||||
};
|
||||
}
|
||||
|
||||
get size() {
|
||||
const {data} = this;
|
||||
if (data.set !== undefined) {
|
||||
return data.set.size;
|
||||
}
|
||||
|
||||
return data.arr.length;
|
||||
}
|
||||
|
||||
keys() {
|
||||
const {data} = this;
|
||||
if (data.set !== undefined) {
|
||||
@@ -49,15 +58,6 @@ export class LazySet {
|
||||
};
|
||||
}
|
||||
|
||||
get size() {
|
||||
const {data} = this;
|
||||
if (data.set !== undefined) {
|
||||
return data.set.size;
|
||||
}
|
||||
|
||||
return data.arr.length;
|
||||
}
|
||||
|
||||
map(f) {
|
||||
return Array.from(this.keys(), f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user