Fix main loop, add example and cleanup

This commit is contained in:
2026-05-04 21:28:22 +01:00
parent 55f4b4d933
commit a51eb903c4
8 changed files with 127 additions and 128 deletions
+2 -7
View File
@@ -158,11 +158,6 @@ struct Rect {
template <typename T>
struct Pool {
Pool() {
items.reserve(20);
free_indices.reserve(20);
}
T &operator[](int index) {
return items[index];
}
@@ -175,10 +170,10 @@ struct Pool {
if (!free_indices.empty()) {
int index = free_indices.back();
free_indices.pop_back();
items[index] = item;
items[index] = std::move(item);
return index;
} else {
items.push_back(item);
items.push_back(std::move(item));
return items.size() - 1;
}
}