From 95c4741229f72bf14239c85fe1f4795f24b0b422 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 11 Aug 2019 09:53:37 +0100 Subject: [PATCH] Remove all-null parameter arrays from the constArgs map --- .../openrs2/deob/transform/DummyTransformer.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/deob/src/main/java/dev/openrs2/deob/transform/DummyTransformer.java b/deob/src/main/java/dev/openrs2/deob/transform/DummyTransformer.java index ef65753708..3f66143d98 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/DummyTransformer.java +++ b/deob/src/main/java/dev/openrs2/deob/transform/DummyTransformer.java @@ -298,12 +298,22 @@ public final class DummyTransformer extends Transformer { for (var method : inheritedMethodSets) { var args = (Type.getArgumentsAndReturnSizes(method.iterator().next().getDesc()) >> 2) - 1; + var allUnknown = true; @SuppressWarnings("unchecked") var parameters = (ImmutableSet[]) new ImmutableSet[args]; for (int i = 0; i < args; i++) { - parameters[i] = union(argValues.get(new ArgRef(method, i))); + var parameter = union(argValues.get(new ArgRef(method, i))); + if (parameter != null) { + allUnknown = false; + } + parameters[i] = parameter; + } + + if (allUnknown) { + constArgs.remove(method); + } else { + constArgs.put(method, parameters); } - constArgs.put(method, parameters); } }