Refactor compareLong method using Long.compare, corrected the local variable name (#1136)
parent
67644de3d9
commit
622ed5a17f
|
@ -6,12 +6,6 @@ package us.codecraft.webmagic.utils;
|
|||
public abstract class NumberUtils {
|
||||
|
||||
public static int compareLong(long o1, long o2) {
|
||||
if (o1 < o2) {
|
||||
return -1;
|
||||
} else if (o1 == o2) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
return Long.compare(o1, o2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,10 +21,10 @@ public class WMCollections {
|
|||
}
|
||||
|
||||
public static <T> List<T> newArrayList(T... t){
|
||||
List<T> set = new ArrayList<T>(t.length);
|
||||
List<T> list = new ArrayList<T>(t.length);
|
||||
for (T t1 : t) {
|
||||
set.add(t1);
|
||||
list.add(t1);
|
||||
}
|
||||
return set;
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue