mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
fix: early return if no files + enhanced for loop
This commit is contained in:
parent
d1c006b260
commit
1452014992
@ -38,8 +38,11 @@ public class OS {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File[] files = dir.listFiles();
|
File[] files = dir.listFiles();
|
||||||
for (int i = 0; i < files.length; i++) {
|
if (files == null) {
|
||||||
File file = files[i];
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (File file : files) {
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
rmdir(file);
|
rmdir(file);
|
||||||
} else {
|
} else {
|
||||||
@ -61,10 +64,12 @@ public class OS {
|
|||||||
public static void cpdir(File src, File dest) throws BrutException {
|
public static void cpdir(File src, File dest) throws BrutException {
|
||||||
dest.mkdirs();
|
dest.mkdirs();
|
||||||
File[] files = src.listFiles();
|
File[] files = src.listFiles();
|
||||||
for (int i = 0; i < files.length; i++) {
|
if (files == null) {
|
||||||
File file = files[i];
|
return;
|
||||||
File destFile = new File(dest.getPath() + File.separatorChar
|
}
|
||||||
+ file.getName());
|
|
||||||
|
for (File file : files) {
|
||||||
|
File destFile = new File(dest.getPath() + File.separatorChar + file.getName());
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
cpdir(file, destFile);
|
cpdir(file, destFile);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user