Uses a StringBuilder to improve performance.

Also stops initializing a variable (removes an unused initialization).
This commit is contained in:
mafagafogigante 2014-11-08 20:35:23 -02:00
parent 031bbe9f09
commit a4637fcf99

View File

@ -29,17 +29,17 @@ public class FileLoader {
try {
BufferedReader br = new BufferedReader(new FileReader(new File(
this.fileName)));
String text = "";
String line = "";
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
text += line + "\n";
sb.append(line).append('\n');
}
this.loaded = true;
br.close();
return text;
return sb.toString();
}
catch (Exception e) {