From 8b3a28311807196953d53f94eeff2b686ec95a0b Mon Sep 17 00:00:00 2001 From: AustrianToast Date: Sun, 5 Mar 2023 00:46:02 +0100 Subject: [PATCH] Removed line variable It just wasn't needed --- src/Matrix.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Matrix.java b/src/Matrix.java index d2c018d..c41176a 100644 --- a/src/Matrix.java +++ b/src/Matrix.java @@ -9,22 +9,19 @@ public class Matrix { } public String[] importCSV(String file) { - String[] result = null; - String line; + String[] result = new String[100]; try { BufferedReader br = new BufferedReader(new FileReader(file)); - - line = br.readLine(); - while (line != null) { - result = line.trim().split(";"); + while (br.readLine() != null) { + result = br.readLine().trim().split(";"); } br.close(); } catch (FileNotFoundException e) { - e.getStackTrace(); + e.printStackTrace(); } catch (IOException e) { - e.getStackTrace(); + e.printStackTrace(); } return result; }