mirror of
https://github.com/revanced/smali.git
synced 2025-05-16 14:17:04 +02:00
Don't use substraction to compare signed integral types, use comparisons
git-svn-id: https://smali.googlecode.com/svn/trunk@427 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
e1b2408a8c
commit
2ec8d992d0
@ -71,7 +71,7 @@ public class ByteEncodedValue extends EncodedValue {
|
|||||||
protected int compareValue(EncodedValue o) {
|
protected int compareValue(EncodedValue o) {
|
||||||
ByteEncodedValue other = (ByteEncodedValue)o;
|
ByteEncodedValue other = (ByteEncodedValue)o;
|
||||||
|
|
||||||
return value - other.value;
|
return (value<other.value?-1:(value>other.value?1:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
@ -78,7 +78,7 @@ public class CharEncodedValue extends EncodedValue {
|
|||||||
protected int compareValue(EncodedValue o) {
|
protected int compareValue(EncodedValue o) {
|
||||||
CharEncodedValue other = (CharEncodedValue)o;
|
CharEncodedValue other = (CharEncodedValue)o;
|
||||||
|
|
||||||
return value - other.value;
|
return (value<other.value?-1:(value>other.value?1:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
@ -76,7 +76,7 @@ public class IntEncodedValue extends EncodedValue {
|
|||||||
protected int compareValue(EncodedValue o) {
|
protected int compareValue(EncodedValue o) {
|
||||||
IntEncodedValue other = (IntEncodedValue)o;
|
IntEncodedValue other = (IntEncodedValue)o;
|
||||||
|
|
||||||
return value - other.value;
|
return (value<other.value?-1:(value>other.value?1:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
@ -76,7 +76,7 @@ public class LongEncodedValue extends EncodedValue {
|
|||||||
protected int compareValue(EncodedValue o) {
|
protected int compareValue(EncodedValue o) {
|
||||||
LongEncodedValue other = (LongEncodedValue)o;
|
LongEncodedValue other = (LongEncodedValue)o;
|
||||||
|
|
||||||
return Long.signum(value - other.value);
|
return (value<other.value?-1:(value>other.value?1:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
@ -76,7 +76,7 @@ public class ShortEncodedValue extends EncodedValue {
|
|||||||
protected int compareValue(EncodedValue o) {
|
protected int compareValue(EncodedValue o) {
|
||||||
ShortEncodedValue other = (ShortEncodedValue)o;
|
ShortEncodedValue other = (ShortEncodedValue)o;
|
||||||
|
|
||||||
return value - other.value;
|
return (value<other.value?-1:(value>other.value?1:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user