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.

lazy_set: Move the size getter above other methods.

Priyank Patel84958bf7eb43
diff --git a/static/js/lazy_set.js b/static/js/lazy_set.js
index 5c4d0876e8a..df39ce916e8 100644
--- a/static/js/lazy_set.js
+++ b/static/js/lazy_set.js
@@ -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);
}