From 547db948935ac73134ee6fb5b88f3fde32d02394 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 12 Nov 2021 08:39:09 +0100 Subject: [PATCH] text java createwordlist method clean up --- src/Text.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Text.java b/src/Text.java index 0f9c165..33274b5 100644 --- a/src/Text.java +++ b/src/Text.java @@ -140,7 +140,7 @@ public class Text { */ public ArrayList index() { HashMap> wordbook = new HashMap<>(); - wordbook = createWordlist(wordbook); + createWordlist(wordbook); String input; ArrayList output = new ArrayList<>(); ArrayList values; @@ -168,7 +168,7 @@ public class Text { * * @return HashMap> */ - private HashMap> createWordlist(HashMap> wordbook) { + private void createWordlist(HashMap> wordbook) { int counter; ArrayList numbersList; String firstLetter; @@ -187,7 +187,6 @@ public class Text { counter = numbersList.get(0); numbersList.remove(0); numbersList.add(0, counter + 1); - if (numbersList.get(numbersList.size() - 1) < i + 1) { numbersList.add(i + 1); } @@ -199,7 +198,6 @@ public class Text { wordbook.put(word, numbersList); } } - return wordbook; } }