* DataHelper: Deprecate inefficient eq() methods

This commit is contained in:
zzz
2010-05-10 14:17:05 +00:00
parent d843646b4f
commit 3fac888fe5

View File

@ -712,12 +712,14 @@ public class DataHelper {
* *
*/ */
public final static boolean eq(byte lhs[], byte rhs[]) { public final static boolean eq(byte lhs[], byte rhs[]) {
// this appears to be the way Arrays.equals is defined, so all the extra tests are unnecessary?
boolean eq = (((lhs == null) && (rhs == null)) || ((lhs != null) && (rhs != null) && (Arrays.equals(lhs, rhs)))); boolean eq = (((lhs == null) && (rhs == null)) || ((lhs != null) && (rhs != null) && (Arrays.equals(lhs, rhs))));
return eq; return eq;
} }
/** /**
* Compare two integers, really just for consistency. * Compare two integers, really just for consistency.
* @deprecated inefficient
*/ */
public final static boolean eq(int lhs, int rhs) { public final static boolean eq(int lhs, int rhs) {
return lhs == rhs; return lhs == rhs;
@ -725,6 +727,7 @@ public class DataHelper {
/** /**
* Compare two longs, really just for consistency. * Compare two longs, really just for consistency.
* @deprecated inefficient
*/ */
public final static boolean eq(long lhs, long rhs) { public final static boolean eq(long lhs, long rhs) {
return lhs == rhs; return lhs == rhs;
@ -732,6 +735,7 @@ public class DataHelper {
/** /**
* Compare two bytes, really just for consistency. * Compare two bytes, really just for consistency.
* @deprecated inefficient
*/ */
public final static boolean eq(byte lhs, byte rhs) { public final static boolean eq(byte lhs, byte rhs) {
return lhs == rhs; return lhs == rhs;