Minor performance improvement for price::is_null()
This commit is contained in:
parent
8a9d3e7775
commit
01a81554ff
1 changed files with 5 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue