mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
654cac9cbe
commit
60d43a3245
|
@ -506,6 +506,12 @@ public class ContactInfo {
|
||||||
Collections.sort(imgs, new Comparator<Element>() {
|
Collections.sort(imgs, new Comparator<Element>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(Element img1, Element img2) {
|
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")
|
boolean i1 = "icon".equalsIgnoreCase(img1.attr("rel")
|
||||||
.replace("shortcut", "").trim());
|
.replace("shortcut", "").trim());
|
||||||
boolean i2 = "icon".equalsIgnoreCase(img2.attr("rel")
|
boolean i2 = "icon".equalsIgnoreCase(img2.attr("rel")
|
||||||
|
@ -514,12 +520,6 @@ public class ContactInfo {
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
return -i;
|
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[] s1 = img1.attr("sizes").split("[x|X]");
|
||||||
String[] s2 = img2.attr("sizes").split("[x|X]");
|
String[] s2 = img2.attr("sizes").split("[x|X]");
|
||||||
Integer w1 = Helper.parseInt(s1.length == 2 ? s1[0] : null);
|
Integer w1 = Helper.parseInt(s1.length == 2 ? s1[0] : null);
|
||||||
|
|
Loading…
Reference in New Issue