You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Use range iterators for RBSet in most cases
This commit is contained in:
@@ -1611,11 +1611,11 @@ void GodotPhysicsServer3D::step(real_t p_step) {
|
||||
island_count = 0;
|
||||
active_objects = 0;
|
||||
collision_pairs = 0;
|
||||
for (RBSet<const GodotSpace3D *>::Element *E = active_spaces.front(); E; E = E->next()) {
|
||||
stepper->step(const_cast<GodotSpace3D *>(E->get()), p_step);
|
||||
island_count += E->get()->get_island_count();
|
||||
active_objects += E->get()->get_active_objects();
|
||||
collision_pairs += E->get()->get_collision_pairs();
|
||||
for (const GodotSpace3D *E : active_spaces) {
|
||||
stepper->step(const_cast<GodotSpace3D *>(E), p_step);
|
||||
island_count += E->get_island_count();
|
||||
active_objects += E->get_active_objects();
|
||||
collision_pairs += E->get_collision_pairs();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1635,8 +1635,8 @@ void GodotPhysicsServer3D::flush_queries() {
|
||||
|
||||
uint64_t time_beg = OS::get_singleton()->get_ticks_usec();
|
||||
|
||||
for (RBSet<const GodotSpace3D *>::Element *E = active_spaces.front(); E; E = E->next()) {
|
||||
GodotSpace3D *space = const_cast<GodotSpace3D *>(E->get());
|
||||
for (const GodotSpace3D *E : active_spaces) {
|
||||
GodotSpace3D *space = const_cast<GodotSpace3D *>(E);
|
||||
space->call_queries();
|
||||
}
|
||||
|
||||
@@ -1656,9 +1656,9 @@ void GodotPhysicsServer3D::flush_queries() {
|
||||
total_time[i] = 0;
|
||||
}
|
||||
|
||||
for (RBSet<const GodotSpace3D *>::Element *E = active_spaces.front(); E; E = E->next()) {
|
||||
for (const GodotSpace3D *E : active_spaces) {
|
||||
for (int i = 0; i < GodotSpace3D::ELAPSED_TIME_MAX; i++) {
|
||||
total_time[i] += E->get()->get_elapsed_time(GodotSpace3D::ElapsedTime(i));
|
||||
total_time[i] += E->get_elapsed_time(GodotSpace3D::ElapsedTime(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user