From df6c9a610c0bf6ceff7c2d10d64cd3a19ddaea47 Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 4 Sep 2020 12:51:55 +0100 Subject: [PATCH] Create singleton sets in LiveVariableAnalyzer where possible This will be slightly more efficient than the existing approach. Signed-off-by: Graham --- .../main/java/dev/openrs2/deob/analysis/LiveVariableAnalyzer.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deob/src/main/java/dev/openrs2/deob/analysis/LiveVariableAnalyzer.kt b/deob/src/main/java/dev/openrs2/deob/analysis/LiveVariableAnalyzer.kt index 1c8c6dd55f..77457c21e1 100644 --- a/deob/src/main/java/dev/openrs2/deob/analysis/LiveVariableAnalyzer.kt +++ b/deob/src/main/java/dev/openrs2/deob/analysis/LiveVariableAnalyzer.kt @@ -47,6 +47,8 @@ public class LiveVariableAnalyzer(owner: String, method: MethodNode) : private fun IntSet.plus(element: Int): IntSet { if (contains(element)) { return this + } else if (isEmpty()) { + return IntSets.singleton(element) } val newSet = IntOpenHashSet(this)