diff src/goodjava/lucene/backup/Backup.java @ 1548:736ec76bbf42

lucene log work
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 27 Sep 2020 22:07:18 -0600
parents 31b543826ca9
children 8dd8c556c449
line wrap: on
line diff
--- a/src/goodjava/lucene/backup/Backup.java	Thu Sep 24 15:33:56 2020 -0600
+++ b/src/goodjava/lucene/backup/Backup.java	Sun Sep 27 22:07:18 2020 -0600
@@ -105,16 +105,16 @@
 		}
 		if( call.cmd.equals("add") ) {
 			boolean complete = true;
-			List<LogFile> logs = new ArrayList<LogFile>();
-			for( Object obj : logInfo ) {
-				Map fileInfo = (Map)obj;
+			final LogFile[] logs = new LogFile[logInfo.size()];
+			for( int i=0; i<logs.length; i++ ) {
+				Map fileInfo = (Map)logInfo.get(i);
 				String name = (String)fileInfo.get("name");
 				File f = new File(dir,name);
 				if( !f.exists() ) {
 					complete = false;
 					break;
 				}
-				logs.add( new LogFile(f) );
+				logs[i] = new LogFile(f);
 			}
 			if( complete ) {
 				LoggingIndexWriter.writeIndex(logs,index);