mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 16:44:25 +02:00
Don't pre-sort ClassDefItems
This commit is contained in:
parent
9a295c54e1
commit
4de8efcc31
@ -197,9 +197,9 @@ public class ClassDefItem extends Item<ClassDefItem> {
|
|||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public int compareTo(ClassDefItem o) {
|
public int compareTo(ClassDefItem o) {
|
||||||
//The actual sorting for this class is implemented in SortClassDefItemSection.
|
//The actual sorting for this class is done during the placement phase, in ClassDefPlacer.
|
||||||
//This method is just used for sorting the associated ClassDataItem items, so
|
//This method is just used for sorting the associated ClassDataItem items after the ClassDefItems have been
|
||||||
//we can just do the comparison based on the offsets of the items
|
//placed, so we can just do the comparison based on the offsets
|
||||||
return this.getOffset() - o.getOffset();
|
return this.getOffset() - o.getOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -773,16 +773,15 @@ public class DexFile
|
|||||||
|
|
||||||
int ret = ClassDefItem.placeClassDefItems(this, offset);
|
int ret = ClassDefItem.placeClassDefItems(this, offset);
|
||||||
|
|
||||||
Collections.sort(this.items, new Comparator<ClassDefItem>() {
|
Collections.sort(this.items);
|
||||||
|
|
||||||
public int compare(ClassDefItem a, ClassDefItem b) {
|
|
||||||
return a.getOffset() - b.getOffset();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.offset = items.get(0).getOffset();
|
this.offset = items.get(0).getOffset();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void sortSection() {
|
||||||
|
// Do nothing. Sorting is handled by ClassDefItem.ClassDefPlacer, during placement
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user