JAL-3141 Slight efficiency gain in detecting backupfiles in the File Chooser
[jalview.git] / src / jalview / io / JalviewFileView.java
index 857d043..52d130c 100755 (executable)
@@ -94,9 +94,16 @@ public class JalviewFileView extends FileView
     if (type == null)
     {
       Iterator<String> it = extensions.keySet().iterator();
-      while (it.hasNext())
+      EXTENSION: while (it.hasNext())
       {
         String ext = it.next();
+
+        // quick negative test
+        if (!f.getName().contains(ext))
+        {
+          continue EXTENSION;
+        }
+
         BackupFilenameParts bfp = BackupFilenameParts
                 .currentBackupFilenameParts(f.getName(), ext, true);
         if (bfp.isBackupFile())