diff options
Diffstat (limited to 'nms-patches/MethodProfiler.patch')
-rw-r--r-- | nms-patches/MethodProfiler.patch | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/nms-patches/MethodProfiler.patch b/nms-patches/MethodProfiler.patch index a8577d4b..2d593086 100644 --- a/nms-patches/MethodProfiler.patch +++ b/nms-patches/MethodProfiler.patch @@ -1,19 +1,19 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/MethodProfiler.java 2014-11-28 17:43:43.253707432 +0000 -+++ src/main/java/net/minecraft/server/MethodProfiler.java 2014-11-28 17:38:17.000000000 +0000 -@@ -10,129 +10,29 @@ +--- /home/matt/mc-dev-private//net/minecraft/server/MethodProfiler.java 2015-02-26 22:40:22.867608136 +0000 ++++ src/main/java/net/minecraft/server/MethodProfiler.java 2015-02-26 22:40:22.871608136 +0000 +@@ -10,130 +10,30 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +// CraftBukkit start - Strip down to empty methods, performance cost public class MethodProfiler { -- + - private static final Logger b = LogManager.getLogger(); -- private final List c = Lists.newArrayList(); -- private final List d = Lists.newArrayList(); +- private final List<String> c = Lists.newArrayList(); +- private final List<Long> d = Lists.newArrayList(); public boolean a; - private String e = ""; -- private final Map f = Maps.newHashMap(); - +- private final Map<String, Long> f = Maps.newHashMap(); +- public MethodProfiler() {} public void a() { @@ -56,7 +56,7 @@ - } } - public List b(String s) { + public List<MethodProfiler.ProfilerInfo> b(String s) { - if (!this.a) { - return null; - } else { @@ -101,7 +101,7 @@ - double d1 = (double) l * 100.0D / (double) i; - String s3 = s2.substring(s.length()); - -- arraylist.add(new ProfilerInfo(s3, d0, d1)); +- arraylist.add(new MethodProfiler.ProfilerInfo(s3, d0, d1)); - } - } - @@ -113,11 +113,11 @@ - } - - if ((float) k > f) { -- arraylist.add(new ProfilerInfo("unspecified", (double) ((float) k - f) * 100.0D / (double) k, (double) ((float) k - f) * 100.0D / (double) i)); +- arraylist.add(new MethodProfiler.ProfilerInfo("unspecified", (double) ((float) k - f) * 100.0D / (double) k, (double) ((float) k - f) * 100.0D / (double) i)); - } - - Collections.sort(arraylist); -- arraylist.add(0, new ProfilerInfo(s, 100.0D, (double) k * 100.0D / (double) i)); +- arraylist.add(0, new MethodProfiler.ProfilerInfo(s, 100.0D, (double) k * 100.0D / (double) i)); - return arraylist; - } + return null; @@ -130,6 +130,16 @@ public String c() { - return this.c.size() == 0 ? "[UNKNOWN]" : (String) this.c.get(this.c.size() - 1); -+ return null; ++ return ""; + } + + public static final class ProfilerInfo implements Comparable<MethodProfiler.ProfilerInfo> { +@@ -152,7 +52,7 @@ + return methodprofiler_profilerinfo.a < this.a ? -1 : (methodprofiler_profilerinfo.a > this.a ? 1 : methodprofiler_profilerinfo.c.compareTo(this.c)); + } + +- public int compareTo(Object object) { ++ public int compareTo(MethodProfiler.ProfilerInfo object) { + return this.a((MethodProfiler.ProfilerInfo) object); + } } - } |