mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 02:33:37 +02:00
small optimization: check before lock
This commit is contained in:
parent
0a8c640ab5
commit
580b6a3b2c
1 changed files with 4 additions and 4 deletions
|
@ -2246,8 +2246,8 @@ void EntityTree::preUpdate() {
|
|||
void EntityTree::update(bool simulate) {
|
||||
PROFILE_RANGE(simulation_physics, "UpdateTree");
|
||||
PerformanceTimer perfTimer("updateTree");
|
||||
withWriteLock([&] {
|
||||
if (simulate && _simulation) {
|
||||
if (simulate && _simulation) {
|
||||
withWriteLock([&] {
|
||||
_simulation->updateEntities();
|
||||
{
|
||||
PROFILE_RANGE(simulation_physics, "Deletes");
|
||||
|
@ -2265,8 +2265,8 @@ void EntityTree::update(bool simulate) {
|
|||
deleteEntities(idsToDelete, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
quint64 EntityTree::getAdjustedConsiderSince(quint64 sinceTime) {
|
||||
|
|
Loading…
Reference in a new issue