reduce memory usage while reading help file

This commit is contained in:
dymik739 2023-03-16 09:27:02 +02:00
parent 4ba6832845
commit 8f131a0129
1 changed files with 2 additions and 5 deletions

View File

@ -10,7 +10,6 @@ import java.io.BufferedInputStream;
import java.io.FileOutputStream;
public class Main {
public static void main(String[] args) {
boolean help_enqueued = false;
boolean allow_networking = true;
@ -80,14 +79,12 @@ public class Main {
}
Scanner help_file_scanner = new Scanner(help_file);
String help_text = "";
while (help_file_scanner.hasNextLine()) {
help_text += help_file_scanner.nextLine();
System.out.print(help_file_scanner.nextLine());
}
help_file_scanner.close();
System.out.println(help_text);
} catch (Exception e) {
System.out.println("[ERROR] Failed to read help due to the following exception: " + e);
System.exit(1);