Skip to content

Commit c95c650

Browse files
JakeWhartonakarnokd
authored andcommitted
Remove needless static field for initialization. (#4269)
1 parent f2591cb commit c95c650

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/rx/internal/util/RxRingBuffer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ public class RxRingBuffer implements Subscription {
241241
* r.o.OperatorObserveOnPerf.observeOnNewThread 1000000 thrpt 5 1.173 0.100 ops/s
242242
* } </pre>
243243
*/
244-
static int defaultSize = 128;
245244
static {
245+
int defaultSize = 128;
246+
246247
// lower default for Android (https://github.com/ReactiveX/RxJava/issues/1820)
247248
if (PlatformDependent.isAndroid()) {
248249
defaultSize = 16;
@@ -257,8 +258,10 @@ public class RxRingBuffer implements Subscription {
257258
System.err.println("Failed to set 'rx.buffer.size' with value " + sizeFromProperty + " => " + e.getMessage()); // NOPMD
258259
}
259260
}
261+
262+
SIZE = defaultSize;
260263
}
261-
public static final int SIZE = defaultSize;
264+
public static final int SIZE;
262265

263266
/* Public so Schedulers can manage the lifecycle of the inner worker. */
264267
public static final ObjectPool<Queue<Object>> SPSC_POOL = new ObjectPool<Queue<Object>>() {

0 commit comments

Comments
 (0)