Allow the default "warning size" for DSets to be set with a property.

This commit is contained in:
Ray J. Greenwell
2026-05-14 12:33:18 -07:00
parent 201e6bf766
commit 3733ea02f5
@@ -41,6 +41,15 @@ import static com.threerings.presents.Log.log;
public class DSet<E extends DSet.Entry> public class DSet<E extends DSet.Entry>
implements Iterable<E>, Streamable, Cloneable implements Iterable<E>, Streamable, Cloneable
{ {
/**
* The default size above which we will warn. This can be overridden per-DSet if you have
* a special DSet class which you probably don't.
* Ths system property "com.threerings.presents.dobj.DSet.warnSize" and the default value is
* 2048.
*/
public static final int DEFAULT_WARNING_SIZE =
Integer.getInteger("com.threerings.presents.dobj.DSet.warnSize", 2048);
/** /**
* Entries of the set must implement this interface. * Entries of the set must implement this interface.
*/ */
@@ -429,7 +438,7 @@ public class DSet<E extends DSet.Entry>
*/ */
protected int getWarningSize () protected int getWarningSize ()
{ {
return 2048; return DEFAULT_WARNING_SIZE;
} }
/** /**