small performance improvement,

avoid recalculation of fileName in File.getName()
This commit is contained in:
Lars Kühne 2003-02-15 12:19:34 +00:00
parent 00fb7f0c18
commit ebfc07bcbd
1 changed files with 2 additions and 1 deletions

View File

@ -76,9 +76,10 @@ public abstract class AbstractFileSetCheck
ArrayList files = new ArrayList(aFiles.length);
for (int i = 0; i < aFiles.length; i++) {
File file = aFiles[i];
final String fileName = file.getName();
for (int j = 0; j < mFileExtensions.length; j++) {
String fileExtension = mFileExtensions[j];
if (file.getName().endsWith(fileExtension)) {
if (fileName.endsWith(fileExtension)) {
files.add(file);
}
}