mirror of https://github.com/status-im/evmc.git
mocked_host: Apply suggestions from code review
This commit is contained in:
parent
b4ae4233f8
commit
52e09fc523
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <evmc/evmc.hpp>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
@ -76,9 +75,7 @@ public:
|
|||
/// Equal operator.
|
||||
bool operator==(const log_record& other) const noexcept
|
||||
{
|
||||
return creator == other.creator && data == other.data &&
|
||||
topics.size() == other.topics.size() &&
|
||||
std::equal(topics.begin(), topics.end(), other.topics.begin());
|
||||
return creator == other.creator && data == other.data && topics == other.topics;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -188,8 +185,7 @@ protected:
|
|||
if (old.value == value)
|
||||
return EVMC_STORAGE_UNCHANGED;
|
||||
|
||||
evmc_storage_status status;
|
||||
{
|
||||
evmc_storage_status status{};
|
||||
if (!old.dirty)
|
||||
{
|
||||
old.dirty = true;
|
||||
|
@ -202,7 +198,6 @@ protected:
|
|||
}
|
||||
else
|
||||
status = EVMC_STORAGE_MODIFIED_AGAIN;
|
||||
}
|
||||
|
||||
old.value = value;
|
||||
return status;
|
||||
|
@ -311,10 +306,7 @@ protected:
|
|||
const bytes32 topics[],
|
||||
size_t topics_count) noexcept override
|
||||
{
|
||||
recorded_logs.push_back({addr, {data, data_size}, {}});
|
||||
auto& record_topics = recorded_logs.back().topics;
|
||||
record_topics.reserve(topics_count);
|
||||
std::copy_n(topics, topics_count, std::back_inserter(record_topics));
|
||||
recorded_logs.push_back({addr, {data, data_size}, {topics, topics + topics_count}});
|
||||
}
|
||||
};
|
||||
} // namespace evmc
|
||||
|
|
Loading…
Reference in New Issue