Replaces all custom number comparisons with java provided ones. (#3434)

This commit is contained in:
yueh
2018-05-27 21:33:59 +02:00
committed by GitHub
parent 044e639827
commit 2894a7caa0
7 changed files with 12 additions and 57 deletions
+2 -41
View File
@@ -80,9 +80,9 @@ public class ItemSorters
{
if( getDirection() == SortDir.ASCENDING )
{
return compareLong( o2.getStackSize(), o1.getStackSize() );
return Long.compare( o2.getStackSize(), o1.getStackSize() );
}
return compareLong( o1.getStackSize(), o2.getStackSize() );
return Long.compare( o1.getStackSize(), o2.getStackSize() );
}
};
private static IInvTweaks api;
@@ -124,45 +124,6 @@ public class ItemSorters
}
}
public static int compareInt( final int a, final int b )
{
if( a == b )
{
return 0;
}
if( a < b )
{
return -1;
}
return 1;
}
public static int compareLong( final long a, final long b )
{
if( a == b )
{
return 0;
}
if( a < b )
{
return -1;
}
return 1;
}
public static int compareDouble( final double a, final double b )
{
if( a == b )
{
return 0;
}
if( a < b )
{
return -1;
}
return 1;
}
private static SortDir getDirection()
{
return Direction;