Skip to content

Commit 99d8d7b

Browse files
committed
Address reviewer comments.
1 parent 05001be commit 99d8d7b

File tree

1 file changed

+3
-4
lines changed
  • firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/internal

1 file changed

+3
-4
lines changed

firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/internal/ModelFileManager.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ public static ModelFileManager getInstance() {
6565

6666
void deleteNonLatestCustomModels() throws FirebaseMlException {
6767
File root = getDirImpl("");
68-
// for each custom model sub directory
6968

7069
boolean ret = true;
7170
if (root.isDirectory()) {
72-
for (File f : Preconditions.checkNotNull(root.listFiles())) {
73-
// extract customModelName
71+
for (File f : root.listFiles()) {
72+
// for each custom model sub directory - extract customModelName and clean up old models.
7473
String modelName = f.getName();
7574

7675
CustomModel model = sharedPreferencesUtil.getCustomModelDetails(modelName);
@@ -250,7 +249,7 @@ boolean deleteRecursively(@Nullable File root) {
250249

251250
boolean ret = true;
252251
if (root.isDirectory()) {
253-
for (File f : Preconditions.checkNotNull(root.listFiles())) {
252+
for (File f : root.listFiles()) {
254253
ret = ret && deleteRecursively(f);
255254
}
256255
}

0 commit comments

Comments
 (0)