mirror of
https://github.com/revanced/smali.git
synced 2025-05-06 01:24:24 +02:00
Using sorted static field set in EncodedArrayPool Key.
This commit is contained in:
parent
1d4b31a11c
commit
8191cd9a7a
@ -140,12 +140,13 @@ public class EncodedArrayPool {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static Key of(@Nonnull ClassDef classDef) {
|
public static Key of(@Nonnull ClassDef classDef) {
|
||||||
Set<? extends Field> staticFields = FluentIterable.from(classDef.getFields()).filter(IS_STATIC_FIELD).toSet();
|
Set<? extends Field> staticFieldsSorted = FluentIterable.from(classDef.getFields())
|
||||||
Iterable<? extends Field> staticFieldsSorted = FluentIterable.from(staticFields).toSortedSet(new FieldComparator());
|
.filter(IS_STATIC_FIELD)
|
||||||
|
.toSortedSet(new FieldComparator());
|
||||||
|
|
||||||
int lastIndex = CollectionUtils.lastIndexOf(staticFieldsSorted, HAS_INITIALIZER);
|
int lastIndex = CollectionUtils.lastIndexOf(staticFieldsSorted, HAS_INITIALIZER);
|
||||||
if (lastIndex > -1) {
|
if (lastIndex > -1) {
|
||||||
return new Key(staticFields, lastIndex+1);
|
return new Key(staticFieldsSorted, lastIndex+1);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user