Skip to content

Commit

Permalink
Remove unneeded try/catch.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed May 18, 2023
1 parent 7b4b55a commit 3ae59db
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions libraries/chain/include/eosio/chain/abi_serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,18 +1095,14 @@ class caching_resolver {
return *it->second;
return {};
}
try {
auto serializer = resolver_(account);
auto& dest = abi_serializers[account]; // add entry regardless
if (serializer) {
// we got a serializer, so move it into the cache
dest = abi_serializer_cache_t::mapped_type{std::move(*serializer)};
return *dest; // and return a reference to it
}
return {};
} catch( ... ) {
throw; // throw if embedded resolver throws
auto serializer = resolver_(account);
auto& dest = abi_serializers[account]; // add entry regardless
if (serializer) {
// we got a serializer, so move it into the cache
dest = abi_serializer_cache_t::mapped_type{std::move(*serializer)};
return *dest; // and return a reference to it
}
return {};
};

private:
Expand Down

0 comments on commit 3ae59db

Please sign in to comment.