From e57a7729c85f384891d5beac92cd5bbd4ee21f2b Mon Sep 17 00:00:00 2001 From: BloodWorkXGaming Date: Tue, 14 Aug 2018 00:44:55 +0200 Subject: [PATCH] Improve performance of adding strings to a Suffix Tree (#1329) --- gradle.properties | 2 +- src/main/java/mezz/jei/suffixtree/Node.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index df5b44d65..cb255f296 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ curse_project_id=238222 version_major=4 version_minor=11 -version_patch=0 +version_patch=1 diff --git a/src/main/java/mezz/jei/suffixtree/Node.java b/src/main/java/mezz/jei/suffixtree/Node.java index 3a65154d6..8ed018870 100644 --- a/src/main/java/mezz/jei/suffixtree/Node.java +++ b/src/main/java/mezz/jei/suffixtree/Node.java @@ -91,7 +91,8 @@ boolean addRef(int index) { // add this reference to all the suffixes as well Node iter = this.suffix; while (iter != null) { - if (iter.addRef(index)) { + if (!iter.contains(index)) { + iter.addIndex(index); iter = iter.suffix; } else { break;