Skip to content

Commit

Permalink
GH-677 Revert unneeded explicit copy
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Feb 8, 2023
1 parent 2eb0b43 commit 34baed9
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions libraries/chain/abi_serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,8 @@ namespace eosio { namespace chain {
variants.clear();
action_results.clear();

for( auto& st : abi.structs ) {
// side effect rules indicate std::move can happen before st.name is accessed.
auto n = st.name;
structs[std::move(n)] = std::move(st);
}
for( auto& st : abi.structs )
structs[st.name] = std::move(st);

for( auto& td : abi.types ) {
EOS_ASSERT(!_is_type(td.new_type_name, ctx), duplicate_abi_type_def_exception,
Expand All @@ -170,11 +167,8 @@ namespace eosio { namespace chain {
for( auto& e : abi.error_messages )
error_messages[std::move(e.error_code)] = std::move(e.error_msg);

for( auto& v : abi.variants.value ) {
// Not strictly necessary since trivially copyable, but error on safe side in case name becomes std::string
auto n = v.name;
variants[std::move(n)] = std::move(v);
}
for( auto& v : abi.variants.value )
variants[v.name] = std::move(v);

for( auto& r : abi.action_results.value )
action_results[std::move(r.name)] = std::move(r.result_type);
Expand Down

0 comments on commit 34baed9

Please sign in to comment.