From 7904690ecf5f5b8dd59014f656f48942c10460ed Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 14 Oct 2023 14:00:58 +0200 Subject: [PATCH] Cleanuo some old code style --- Source/Engine/Content/Content.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp index c4ce37dcb..236c9400b 100644 --- a/Source/Engine/Content/Content.cpp +++ b/Source/Engine/Content/Content.cpp @@ -697,13 +697,11 @@ bool Content::CloneAssetFile(const StringView& dstPath, const StringView& srcPat LOG(Warning, "Cannot copy file to destination."); return true; } - if (JsonStorageProxy::ChangeId(dstPath, dstId)) { LOG(Warning, "Cannot change asset ID."); return true; } - return false; } @@ -768,12 +766,9 @@ bool Content::CloneAssetFile(const StringView& dstPath, const StringView& srcPat FileSystem::DeleteFile(tmpPath); // Reload storage + if (auto storage = ContentStorageManager::GetStorage(dstPath)) { - auto storage = ContentStorageManager::GetStorage(dstPath); - if (storage) - { - storage->Reload(); - } + storage->Reload(); } } @@ -911,12 +906,8 @@ bool Content::IsAssetTypeIdInvalid(const ScriptingTypeHandle& type, const Script Asset* Content::LoadAsync(const Guid& id, const ScriptingTypeHandle& type) { - // Early out if (!id.IsValid()) - { - // Back return nullptr; - } // Check if asset has been already loaded Asset* result = GetAsset(id); @@ -928,7 +919,6 @@ Asset* Content::LoadAsync(const Guid& id, const ScriptingTypeHandle& type) LOG(Warning, "Different loaded asset type! Asset: \'{0}\'. Expected type: {1}", result->ToString(), type.ToString()); return nullptr; } - return result; } @@ -946,12 +936,8 @@ Asset* Content::LoadAsync(const Guid& id, const ScriptingTypeHandle& type) LoadCallAssetsLocker.Lock(); const bool contains = LoadCallAssets.Contains(id); LoadCallAssetsLocker.Unlock(); - if (!contains) - { return GetAsset(id); - } - Platform::Sleep(1); } } @@ -959,7 +945,6 @@ Asset* Content::LoadAsync(const Guid& id, const ScriptingTypeHandle& type) { // Mark asset as loading LoadCallAssets.Add(id); - LoadCallAssetsLocker.Unlock(); }