Skip to content

Commit cdabece

Browse files
committed
use loadStrings() instead of custom BufferedReader
1 parent 6108ac4 commit cdabece

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/src/processing/app/Mode.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ protected void loadKeywords(File keywordFile) throws IOException {
138138
@SuppressWarnings("SameParameterValue")
139139
protected void loadKeywords(File keywordFile,
140140
String commentPrefix) throws IOException {
141-
BufferedReader reader = PApplet.createReader(keywordFile);
142-
String line;
143-
while ((line = reader.readLine()) != null) {
141+
String[] lines = PApplet.loadStrings(keywordFile);
142+
for (String line : lines) {
144143
if (!line.trim().startsWith(commentPrefix)) {
145144
// Was difficult to make sure that mode authors were properly doing
146145
// tab-separated values. By definition, there can't be additional
@@ -173,7 +172,6 @@ protected void loadKeywords(File keywordFile,
173172
}
174173
}
175174
}
176-
reader.close();
177175
}
178176

179177

0 commit comments

Comments
 (0)