Refactoring

This commit is contained in:
M66B 2020-12-11 19:53:10 +01:00
parent 654cac9cbe
commit 60d43a3245
1 changed files with 6 additions and 6 deletions

View File

@ -506,6 +506,12 @@ public class ContactInfo {
Collections.sort(imgs, new Comparator<Element>() {
@Override
public int compare(Element img1, Element img2) {
boolean l1 = "link".equals(img1.tagName());
boolean l2 = "link".equals(img2.tagName());
int l = Boolean.compare(l1, l2);
if (l != 0)
return -l;
boolean i1 = "icon".equalsIgnoreCase(img1.attr("rel")
.replace("shortcut", "").trim());
boolean i2 = "icon".equalsIgnoreCase(img2.attr("rel")
@ -514,12 +520,6 @@ public class ContactInfo {
if (i != 0)
return -i;
boolean l1 = "link".equals(img1.tagName());
boolean l2 = "link".equals(img2.tagName());
int l = Boolean.compare(l1, l2);
if (l != 0)
return -l;
String[] s1 = img1.attr("sizes").split("[x|X]");
String[] s2 = img2.attr("sizes").split("[x|X]");
Integer w1 = Helper.parseInt(s1.length == 2 ? s1[0] : null);