Address some review feedback
Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
This commit is contained in:
@@ -14,21 +14,21 @@
|
||||
namespace AZ::Dom
|
||||
{
|
||||
PatchOperation::PatchOperation(Path destinationPath, Type type, Value value)
|
||||
: m_domPath(destinationPath)
|
||||
: m_domPath(AZStd::move(destinationPath))
|
||||
, m_type(type)
|
||||
, m_value(value)
|
||||
, m_value(AZStd::move(value))
|
||||
{
|
||||
}
|
||||
|
||||
PatchOperation::PatchOperation(Path destinationPath, Type type, Path sourcePath)
|
||||
: m_domPath(destinationPath)
|
||||
: m_domPath(AZStd::move(destinationPath))
|
||||
, m_type(type)
|
||||
, m_value(sourcePath)
|
||||
, m_value(AZStd::move(sourcePath))
|
||||
{
|
||||
}
|
||||
|
||||
PatchOperation::PatchOperation(Path destinationPath, Type type)
|
||||
: m_domPath(destinationPath)
|
||||
: m_domPath(AZStd::move(destinationPath))
|
||||
, m_type(type)
|
||||
{
|
||||
}
|
||||
@@ -690,22 +690,22 @@ namespace AZ::Dom
|
||||
|
||||
auto Patch::begin() const -> OperationsContainer::const_iterator
|
||||
{
|
||||
return m_operations.cbegin();
|
||||
return m_operations.begin();
|
||||
}
|
||||
|
||||
auto Patch::end() const -> OperationsContainer::const_iterator
|
||||
{
|
||||
return m_operations.cend();
|
||||
return m_operations.end();
|
||||
}
|
||||
|
||||
auto Patch::cbegin() const -> OperationsContainer::const_iterator
|
||||
{
|
||||
return m_operations.cbegin();
|
||||
return m_operations.begin();
|
||||
}
|
||||
|
||||
auto Patch::cend() const -> OperationsContainer::const_iterator
|
||||
{
|
||||
return m_operations.cend();
|
||||
return m_operations.end();
|
||||
}
|
||||
|
||||
size_t Patch::size() const
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <AzCore/DOM/DomPath.h>
|
||||
#include <AzCore/DOM/DomValue.h>
|
||||
#include <AzCore/std/containers/deque.h>
|
||||
|
||||
namespace AZ::Dom
|
||||
{
|
||||
@@ -108,12 +109,12 @@ namespace AZ::Dom
|
||||
//! The current state of a Patch application operation.
|
||||
struct PatchApplicationState
|
||||
{
|
||||
//! The outcome of the last operation, may be overridden to produce a different failure outcome.
|
||||
PatchOperation::PatchOutcome m_outcome;
|
||||
//! The patch being applied.
|
||||
const Patch* m_patch = nullptr;
|
||||
//! The last operation attempted.
|
||||
const PatchOperation* m_lastOperation = nullptr;
|
||||
//! The outcome of the last operation, may be overridden to produce a different failure outcome.
|
||||
PatchOperation::PatchOutcome m_outcome;
|
||||
//! The current state of the value being patched, will be returned if the patch operation succeeds.
|
||||
Value* m_currentState = nullptr;
|
||||
//! If set to false, the patch operation should halt.
|
||||
@@ -134,7 +135,7 @@ namespace AZ::Dom
|
||||
{
|
||||
public:
|
||||
using StrategyFunctor = AZStd::function<void(PatchApplicationState&)>;
|
||||
using OperationsContainer = AZStd::vector<PatchOperation>;
|
||||
using OperationsContainer = AZStd::deque<PatchOperation>;
|
||||
|
||||
Patch() = default;
|
||||
Patch(const Patch&) = default;
|
||||
@@ -193,6 +194,7 @@ namespace AZ::Dom
|
||||
struct DeltaPatchGenerationParameters
|
||||
{
|
||||
static constexpr size_t NoReplace = AZStd::numeric_limits<size_t>::max();
|
||||
static constexpr size_t AlwaysFullReplace = 0;
|
||||
|
||||
//! The threshold of changed values in a node or array which, if exceeded, will cause the generation to create an
|
||||
//! entire "replace" oepration instead. If set to NoReplace, no replacement will occur.
|
||||
|
||||
@@ -106,12 +106,12 @@ namespace AZ::Dom::Benchmark
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
name == name;
|
||||
name == index;
|
||||
name == endOfArray;
|
||||
index == index;
|
||||
index == endOfArray;
|
||||
endOfArray == endOfArray;
|
||||
benchmark::DoNotOptimize(name == name);
|
||||
benchmark::DoNotOptimize(name == index);
|
||||
benchmark::DoNotOptimize(name == endOfArray);
|
||||
benchmark::DoNotOptimize(index == index);
|
||||
benchmark::DoNotOptimize(index == endOfArray);
|
||||
benchmark::DoNotOptimize(endOfArray == endOfArray);
|
||||
}
|
||||
|
||||
state.SetItemsProcessed(6 * state.iterations());
|
||||
|
||||
Reference in New Issue
Block a user