Refactor compareLong method using Long.compare, corrected the local variable name (#1136)

pull/1137/head
Harikrishna 1 year ago committed by GitHub
parent 67644de3d9
commit 622ed5a17f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save