Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move instance field to static #714

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
public final class BitmapContainer extends Container implements Cloneable {
public static final int MAX_CAPACITY = 1 << 16;

private static final int MAX_CAPACITY_BYTE = MAX_CAPACITY / Byte.SIZE;

private static final int MAX_CAPACITY_LONG = MAX_CAPACITY / Long.SIZE;

private static final long serialVersionUID = 2L;

Expand Down Expand Up @@ -69,15 +72,15 @@ protected static int serializedSizeInBytes(int unusedCardinality) {

// nruns value for which RunContainer.serializedSizeInBytes ==
// BitmapContainer.getArraySizeInBytes()
private final int MAXRUNS = (getArraySizeInBytes() - 2) / 4;
private static final int MAXRUNS = (MAX_CAPACITY_BYTE - 2) / 4;


/**
* Create a bitmap container with all bits set to false
*/
public BitmapContainer() {
this.cardinality = 0;
this.bitmap = new long[MAX_CAPACITY / 64];
this.bitmap = new long[MAX_CAPACITY_LONG];
}


Expand Down Expand Up @@ -463,7 +466,7 @@ public Container flip(char i) {

@Override
public int getArraySizeInBytes() {
return MAX_CAPACITY / 8;
return MAX_CAPACITY_BYTE;
}

@Override
Expand Down
Loading