mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 10:34:16 +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) {
|
void EntityTree::update(bool simulate) {
|
||||||
PROFILE_RANGE(simulation_physics, "UpdateTree");
|
PROFILE_RANGE(simulation_physics, "UpdateTree");
|
||||||
PerformanceTimer perfTimer("updateTree");
|
PerformanceTimer perfTimer("updateTree");
|
||||||
withWriteLock([&] {
|
if (simulate && _simulation) {
|
||||||
if (simulate && _simulation) {
|
withWriteLock([&] {
|
||||||
_simulation->updateEntities();
|
_simulation->updateEntities();
|
||||||
{
|
{
|
||||||
PROFILE_RANGE(simulation_physics, "Deletes");
|
PROFILE_RANGE(simulation_physics, "Deletes");
|
||||||
|
@ -2265,8 +2265,8 @@ void EntityTree::update(bool simulate) {
|
||||||
deleteEntities(idsToDelete, true);
|
deleteEntities(idsToDelete, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 EntityTree::getAdjustedConsiderSince(quint64 sinceTime) {
|
quint64 EntityTree::getAdjustedConsiderSince(quint64 sinceTime) {
|
||||||
|
|
Loading…
Reference in a new issue