Skip to content

Commit

Permalink
examples: Rework condition in precompiles_vm
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed May 8, 2019
1 parent 3bbeb9b commit e5b5792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/example_precompiles_vm/example_precompiles_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static evmc_result execute(evmc_instance*,
constexpr auto prefix_size = sizeof(evmc_address) - 2;
const auto& dst = msg->destination;
// Check if the address prefix is all zeros.
if (std::count(&dst.bytes[0], &dst.bytes[prefix_size], 0) != prefix_size)
if (std::all_of(&dst.bytes[0], &dst.bytes[prefix_size], [](uint8_t x) { return x == 0; }))
{
// If not, reject the execution request.
auto result = evmc_result{};
Expand Down

0 comments on commit e5b5792

Please sign in to comment.