avoid unneeded read-lock if action-data was dirty

This commit is contained in:
Seth Alves 2015-10-28 09:55:55 -07:00
parent d504f449e4
commit 08a0bf33a4

View file

@ -1795,12 +1795,13 @@ const QByteArray EntityItem::getActionData() const {
EntityItem* unconstThis = const_cast<EntityItem*>(this);
unconstThis->withWriteLock([&] {
getActionDataInternal();
result = _allActionsDataCache;
});
} else {
withReadLock([&] {
result = _allActionsDataCache;
});
}
withReadLock([&] {
result = _allActionsDataCache;
});
return result;
}