mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fixes and cleanups.
This commit is contained in:
@@ -15,8 +15,8 @@ void STAmount::canonicalize()
|
|||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
offset=0;
|
offset = 0;
|
||||||
value=0;
|
value = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (value < cMinValue)
|
while (value < cMinValue)
|
||||||
@@ -116,7 +116,8 @@ bool STAmount::operator!=(const STAmount& a) const
|
|||||||
|
|
||||||
bool STAmount::operator<(const STAmount& a) const
|
bool STAmount::operator<(const STAmount& a) const
|
||||||
{
|
{
|
||||||
if (value == 0) return false;
|
if (a.value == 0) return false;
|
||||||
|
if (value == 0) return true;
|
||||||
if (offset < a.offset) return true;
|
if (offset < a.offset) return true;
|
||||||
if (a.offset < offset) return false;
|
if (a.offset < offset) return false;
|
||||||
return value < a.value;
|
return value < a.value;
|
||||||
@@ -124,7 +125,8 @@ bool STAmount::operator<(const STAmount& a) const
|
|||||||
|
|
||||||
bool STAmount::operator>(const STAmount& a) const
|
bool STAmount::operator>(const STAmount& a) const
|
||||||
{
|
{
|
||||||
if (value == 0) return a.value != 0;
|
if (value == 0) return false;
|
||||||
|
if (a.value == 0) return true;
|
||||||
if (offset > a.offset) return true;
|
if (offset > a.offset) return true;
|
||||||
if (a.offset > offset) return false;
|
if (a.offset > offset) return false;
|
||||||
return value > a.value;
|
return value > a.value;
|
||||||
@@ -132,7 +134,8 @@ bool STAmount::operator>(const STAmount& a) const
|
|||||||
|
|
||||||
bool STAmount::operator<=(const STAmount& a) const
|
bool STAmount::operator<=(const STAmount& a) const
|
||||||
{
|
{
|
||||||
if (value == 0) return a.value == 0;
|
if (value == 0) return true;
|
||||||
|
if (a.value == 0) return false;
|
||||||
if (offset < a.offset) return true;
|
if (offset < a.offset) return true;
|
||||||
if (a.offset < offset) return false;
|
if (a.offset < offset) return false;
|
||||||
return value <= a.value;
|
return value <= a.value;
|
||||||
@@ -140,7 +143,8 @@ bool STAmount::operator<=(const STAmount& a) const
|
|||||||
|
|
||||||
bool STAmount::operator>=(const STAmount& a) const
|
bool STAmount::operator>=(const STAmount& a) const
|
||||||
{
|
{
|
||||||
if (value == 0) return true;
|
if (a.value == 0) return true;
|
||||||
|
if (value == 0) return false;
|
||||||
if (offset > a.offset) return true;
|
if (offset > a.offset) return true;
|
||||||
if (a.offset > offset) return false;
|
if (a.offset > offset) return false;
|
||||||
return value >= a.value;
|
return value >= a.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user