mirror of
https://github.com/revanced/smali.git
synced 2025-05-03 08:04:28 +02:00
First filtering for static fields, then sorting them. Using filtered list in a Key. Removed deprecated guava methods.
This commit is contained in:
parent
0e56199557
commit
1d4b31a11c
@ -140,13 +140,12 @@ public class EncodedArrayPool {
|
||||
|
||||
@Nullable
|
||||
public static Key of(@Nonnull ClassDef classDef) {
|
||||
Set<? extends Field> fields = FluentIterable.from(classDef.getFields()).toImmutableSortedSet(new FieldComparator());
|
||||
|
||||
Iterable<? extends Field> staticFields = FluentIterable.from(fields).filter(IS_STATIC_FIELD);
|
||||
int lastIndex = CollectionUtils.lastIndexOf(staticFields, HAS_INITIALIZER);
|
||||
Set<? extends Field> staticFields = FluentIterable.from(classDef.getFields()).filter(IS_STATIC_FIELD).toSet();
|
||||
Iterable<? extends Field> staticFieldsSorted = FluentIterable.from(staticFields).toSortedSet(new FieldComparator());
|
||||
|
||||
int lastIndex = CollectionUtils.lastIndexOf(staticFieldsSorted, HAS_INITIALIZER);
|
||||
if (lastIndex > -1) {
|
||||
return new Key(fields, lastIndex+1);
|
||||
return new Key(staticFields, lastIndex+1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -158,7 +157,6 @@ public class EncodedArrayPool {
|
||||
@Nonnull
|
||||
public Iterable<EncodedValue> getElements() {
|
||||
return FluentIterable.from(fields)
|
||||
.filter(IS_STATIC_FIELD)
|
||||
.limit(size)
|
||||
.transform(GET_INITIAL_VALUE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user