Skip to content

Commit

Permalink
Move calculation outside lambda to work around Clang optimization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sgerbino committed Jul 24, 2019
1 parent 777e991 commit 23da075
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/tests/operation_time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2766,11 +2766,13 @@ BOOST_AUTO_TEST_CASE( sbd_stability )
});
}, database::skip_witness_signature );

auto current_sbd_supply = alice_sbd + asset( ( ( gpo.sbd_start_percent - 9 ) * sbd_balance.amount ) / gpo.sbd_stop_percent, SBD_SYMBOL ) + db->get_account( STEEM_TREASURY_ACCOUNT ).sbd_balance;

db_plugin->debug_update( [=]( database& db )
{
db.modify( db.get_dynamic_global_properties(), [&]( dynamic_global_property_object& gpo )
{
gpo.current_sbd_supply = alice_sbd + asset( ( ( gpo.sbd_start_percent - 9 ) * sbd_balance.amount ) / gpo.sbd_stop_percent, SBD_SYMBOL ) + db.get_account( STEEM_TREASURY_ACCOUNT ).sbd_balance;
gpo.current_sbd_supply = current_sbd_supply;
});
}, database::skip_witness_signature );

Expand Down

0 comments on commit 23da075

Please sign in to comment.