Update dependencies
Settings activity refactor
This commit is contained in:
248 files changed
+8700
-8980
No files matched your search
@@ -21,22 +21,22 @@ package com.hippo.util;
|
||||
|
||||
public class HashCodeUtils {
|
||||
|
||||
private static final int X = 31;
|
||||
private static final int X = 31;
|
||||
|
||||
/**
|
||||
* <pre>{@code
|
||||
* args[0].hashCode()*31^(n-1) + args[1].hashCode()*31^(n-2) + ... + args[n-1].hashCode()
|
||||
* }</pre>
|
||||
* Returns 0 if {@code args == null}.
|
||||
*/
|
||||
public static int hashCode(Object... args) {
|
||||
if (args == null) {
|
||||
return 0;
|
||||
/**
|
||||
* <pre>{@code
|
||||
* args[0].hashCode()*31^(n-1) + args[1].hashCode()*31^(n-2) + ... + args[n-1].hashCode()
|
||||
* }</pre>
|
||||
* Returns 0 if {@code args == null}.
|
||||
*/
|
||||
public static int hashCode(Object... args) {
|
||||
if (args == null) {
|
||||
return 0;
|
||||
}
|
||||
int hash = 0;
|
||||
for (Object o : args) {
|
||||
hash = X * hash + (o != null ? o.hashCode() : 0);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
int hash = 0;
|
||||
for (Object o: args) {
|
||||
hash = X * hash + (o != null ? o.hashCode() : 0);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user