From cdabecebb355a110fd3cba56ae0e2ff3a4ada103 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Tue, 18 Jan 2022 17:21:54 -0500 Subject: [PATCH] use loadStrings() instead of custom BufferedReader --- app/src/processing/app/Mode.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/Mode.java b/app/src/processing/app/Mode.java index 9ca9e641e..384da8388 100644 --- a/app/src/processing/app/Mode.java +++ b/app/src/processing/app/Mode.java @@ -138,9 +138,8 @@ public abstract class Mode { @SuppressWarnings("SameParameterValue") protected void loadKeywords(File keywordFile, String commentPrefix) throws IOException { - BufferedReader reader = PApplet.createReader(keywordFile); - String line; - while ((line = reader.readLine()) != null) { + String[] lines = PApplet.loadStrings(keywordFile); + for (String line : lines) { if (!line.trim().startsWith(commentPrefix)) { // Was difficult to make sure that mode authors were properly doing // tab-separated values. By definition, there can't be additional @@ -173,7 +172,6 @@ public abstract class Mode { } } } - reader.close(); }