perf: lazy

This commit is contained in:
cha0s 2024-08-05 13:12:58 -05:00
parent d6af0199c9
commit 9afb5bba81

View File

@ -564,10 +564,14 @@ export default class Ecs {
} }
} }
// update indices // update indices
this.deindex(this.$$deindexing); if (this.$$deindexing.size > 0) {
this.$$deindexing.clear(); this.deindex(this.$$deindexing);
this.reindex(this.$$reindexing); this.$$deindexing.clear();
this.$$reindexing.clear(); }
if (this.$$reindexing.size > 0) {
this.reindex(this.$$reindexing);
this.$$reindexing.clear();
}
} }
toJSON() { toJSON() {