Minor performance improvement for price::is_null()

This commit is contained in:
abitmore 2018-07-03 12:24:25 -04:00 committed by gladcow
parent 8a9d3e7775
commit 01a81554ff

View file

@ -130,7 +130,11 @@ namespace graphene { namespace chain {
return ~(asset( cp.numerator().convert_to<int64_t>(), debt.asset_id ) / asset( cp.denominator().convert_to<int64_t>(), collateral.asset_id ));
} FC_CAPTURE_AND_RETHROW( (debt)(collateral)(collateral_ratio) ) }
bool price::is_null() const { return *this == price(); }
bool price::is_null() const
{
// Effectively same as "return *this == price();" but perhaps faster
return ( base.asset_id == asset_id_type() && quote.asset_id == asset_id_type() );
}
void price::validate() const
{ try {