From 6c22e92db683325249e17a5d4ea6b086fa205dc0 Mon Sep 17 00:00:00 2001 From: Artur K <96597+nemerle@users.noreply.github.com> Date: Fri, 6 Aug 2021 03:10:26 +0200 Subject: [PATCH] Use lambda instead of AZStd::bind (#2658) Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- .../AssetManager/SourceFileRelocator.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/AssetManager/SourceFileRelocator.cpp b/Code/Tools/AssetProcessor/native/AssetManager/SourceFileRelocator.cpp index eb0416f125..64e176ffe4 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/SourceFileRelocator.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/SourceFileRelocator.cpp @@ -88,7 +88,7 @@ Please note that only those seed files will get updated that are active for your { scanFolderInfo = nullptr; bool isRelative = AzFramework::StringFunc::Path::IsRelative(normalizedSource.c_str()); - + if (isRelative) { // Relative paths can match multiple files/folders, search each scan folder for a valid match @@ -264,7 +264,7 @@ Please note that only those seed files will get updated that are active for your metaDataFile.m_sourceFileIndex = sourceFileIndex.value(); metadataFiles.emplace_back(metaDataFile); metaDataFileEntries.insert(metadaFileCorrectCase); - } + } } } } @@ -601,7 +601,7 @@ Please note that only those seed files will get updated that are active for your AZ::StringFunc::Path::ReplaceFullName(newDestinationPath, fullFileName.c_str()); } - + if (!AzFramework::StringFunc::Path::IsRelative(newDestinationPath.c_str())) { @@ -1025,14 +1025,14 @@ Please note that only those seed files will get updated that are active for your AZStd::binary_semaphore waitSignal; int errorCount = 0; - AzToolsFramework::SourceControlResponseCallbackBulk callback = AZStd::bind(&HandleSourceControlResult, - AZStd::ref (relocationContainer), - AZStd::ref(waitSignal), - AZStd::ref(errorCount), - static_cast(SCF_OpenByUser), // If a file is moved from A -> B and then again from B -> A, the result is just an "edit", so we're just going to assume success if the file is checked out, regardless of state - true, - AZStd::placeholders::_1, - AZStd::placeholders::_2); + AzToolsFramework::SourceControlResponseCallbackBulk callback = [&](bool success, AZStd::vector info) + { + HandleSourceControlResult( + relocationContainer, waitSignal, errorCount, + SCF_OpenByUser, // If a file is moved from A -> B and then again from B -> A, the result is just an "edit", so we're just going + // to assume success if the file is checked out, regardless of state + true, success, info); + }; AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestRenameBulkExtended, @@ -1049,7 +1049,7 @@ Please note that only those seed files will get updated that are active for your { if (relocationInfo.m_operationStatus == SourceFileRelocationStatus::Succeeded || relocationInfo.m_sourceFileIndex == AssetProcessor::SourceFileRelocationInvalidIndex) { - // we do not want to retry if the move operation already succeeded or if it is a source file + // we do not want to retry if the move operation already succeeded or if it is a source file continue; } @@ -1108,7 +1108,7 @@ Please note that only those seed files will get updated that are active for your { if (entry.m_operationStatus == SourceFileRelocationStatus::Succeeded || entry.m_sourceFileIndex == AssetProcessor::SourceFileRelocationInvalidIndex) { - // we do not want to retry if the move operation already succeeded or if it is a source file + // we do not want to retry if the move operation already succeeded or if it is a source file continue; } @@ -1224,7 +1224,7 @@ Please note that only those seed files will get updated that are active for your m_stateData->QuerySourceByProductID(productDependency.m_productPK, [this, &sourceName, &scanPath](AzToolsFramework::AssetDatabase::SourceDatabaseEntry& entry) { sourceName = entry.m_sourceName; - + m_stateData->QueryScanFolderByScanFolderID(entry.m_scanFolderPK, [&scanPath](AzToolsFramework::AssetDatabase::ScanFolderDatabaseEntry& entry) { scanPath = entry.m_scanFolder;