Skip to content

Commit e74f40f

Browse files
committed
Hardcode MAX_TRACES and MAX_TRACERS
1 parent 5e4a062 commit e74f40f

File tree

1 file changed

+6
-4
lines changed
  • src/main/java/org/algorithm_visualizer/tracers

1 file changed

+6
-4
lines changed

src/main/java/org/algorithm_visualizer/tracers/Tracer.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public abstract class Tracer {
1212
private static int tracerCount = 0;
1313
private static ArrayList<Trace> traces = new ArrayList<>();
1414

15-
private static final int maxTraces = Integer.parseInt(System.getenv("MAX_TRACES"));
16-
private static final int maxTracers = Integer.parseInt(System.getenv("MAX_TRACERS"));
15+
private static final int MAX_TRACES = 1000000;
16+
private static final int MAX_TRACERS = 100;
1717

1818
private static class Trace {
1919
private String tracerKey;
@@ -38,8 +38,10 @@ private static String addTracer(String className, String title) {
3838
protected static void addTrace(String tracerKey, String method, Object[] args) {
3939
Trace trace = new Trace(tracerKey, method, args);
4040
traces.add(trace);
41-
if (traces.size() > maxTraces) throw new Error("Traces Limit Exceeded");
42-
if (tracerCount > maxTracers) throw new Error("Tracers Limit Exceeded");
41+
if (traces.size() > MAX_TRACES)
42+
throw new Error("Traces Limit Exceeded");
43+
if (tracerCount > MAX_TRACERS)
44+
throw new Error("Tracers Limit Exceeded");
4345
}
4446

4547
protected String key;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy