No effective change - code cleanup - simplify if

This commit is contained in:
Robin Bygrave committed 2015-07-31 14:51:34 +12:00
1 parent 069b83b78d
commit 53cf6c162c
8 files changed
+17 -71

No files matched your search

@@ -9,15 +9,7 @@ public class DmlUtil {
/**
* Return true if the value is null or a Numeric 0 (for primitive int's and long's) or Option empty.
*/
public static boolean isNullOrZero(Object value){
if (value == null){
return true;
}
if (value instanceof Number){
return ((Number)value).longValue() == 0l;
}
return false;
}
public static boolean isNullOrZero(Object value) {
return value == null || value instanceof Number && ((Number) value).longValue() == 0l;
}
}