mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-03 10:29:19 +00:00
Minor simplification of getEntry() and getFiles() in ac.java.
This commit is contained in:
parent
a2622bf1e7
commit
82cfbef908
@ -231,8 +231,8 @@ public class ac {
|
||||
Disk disk = new Disk(imageName);
|
||||
if (directory.length() > 0) {
|
||||
// Add a final directory separator if the user didn't supply one
|
||||
if (!directory.endsWith(System.getProperty("file.separator")))
|
||||
directory = directory + System.getProperty("file.separator");
|
||||
if (!directory.endsWith(File.separator))
|
||||
directory = directory + File.separator;
|
||||
}
|
||||
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
|
||||
for (int i = 0; i < formattedDisks.length; i++) {
|
||||
@ -262,18 +262,18 @@ public class ac {
|
||||
* file with the given filename.
|
||||
*/
|
||||
static FileEntry getEntry(List files, String fileName) {
|
||||
FileEntry theEntry = null;
|
||||
FileEntry entry = null;
|
||||
if (files != null) {
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
FileEntry entry = (FileEntry) files.get(i);
|
||||
entry = (FileEntry) files.get(i);
|
||||
String entryName = entry.getFilename();
|
||||
if (!entry.isDeleted() && fileName.equalsIgnoreCase(entryName)) {
|
||||
return entry;
|
||||
}
|
||||
if (entry.isDirectory()) {
|
||||
theEntry = getEntry(((DirectoryEntry) entry).getFiles(), fileName);
|
||||
if (theEntry != null) {
|
||||
return theEntry;
|
||||
entry = getEntry(((DirectoryEntry) entry).getFiles(), fileName);
|
||||
if (entry != null) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user