Commit 7b7ceb0
committed
refactor(world): optimize entity removal process
- Simplified the entity removal logic by swapping the last entity with the one being removed for O(1) performance.
- Updated component data handling to ensure correct removal and prevent undefined values.
- Removed unnecessary method for calculating final component types, streamlining the code.1 parent 586f512 commit 7b7ceb0
4 files changed
Lines changed: 25 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 109 | + | |
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | | - | |
118 | | - | |
| 113 | + | |
119 | 114 | | |
120 | 115 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 75 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | 607 | | |
611 | | - | |
| 608 | + | |
612 | 609 | | |
613 | | - | |
614 | | - | |
| 610 | + | |
| 611 | + | |
615 | 612 | | |
616 | 613 | | |
617 | 614 | | |
618 | | - | |
| 615 | + | |
619 | 616 | | |
620 | 617 | | |
621 | 618 | | |
| |||
668 | 665 | | |
669 | 666 | | |
670 | 667 | | |
671 | | - | |
| 668 | + | |
672 | 669 | | |
673 | 670 | | |
674 | 671 | | |
| |||
0 commit comments