Replace LinkedList by a more performant collection
This is a semi-automatic change. See https://errorprone.info/bugpattern/JdkObsolete for the rationale. Test: make Bug: 221046110 Change-Id: I8ac18a9b62160f5bffeddf45d79e18e5bb38b69d
This commit is contained in:
@@ -29,7 +29,6 @@ import android.compat.annotation.ChangeId;
|
||||
import android.compat.annotation.Disabled;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.storage.StorageManager;
|
||||
@@ -40,9 +39,9 @@ import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -953,7 +952,7 @@ public class Environment {
|
||||
}
|
||||
|
||||
private static boolean hasInterestingFiles(File dir) {
|
||||
final LinkedList<File> explore = new LinkedList<>();
|
||||
final ArrayDeque<File> explore = new ArrayDeque<>();
|
||||
explore.add(dir);
|
||||
while (!explore.isEmpty()) {
|
||||
dir = explore.pop();
|
||||
|
||||
Reference in New Issue
Block a user