From e5b579220d95d1cc07a127cfa62ff1736bb9cadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 8 May 2019 23:55:18 +0200 Subject: [PATCH] examples: Rework condition in precompiles_vm --- examples/example_precompiles_vm/example_precompiles_vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_precompiles_vm/example_precompiles_vm.cpp b/examples/example_precompiles_vm/example_precompiles_vm.cpp index be144c6a0..2273d7b2c 100644 --- a/examples/example_precompiles_vm/example_precompiles_vm.cpp +++ b/examples/example_precompiles_vm/example_precompiles_vm.cpp @@ -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{};