Skip to content

Commit 49aed30

Browse files
committed
More long -> int conversion.
1 parent b26f1d3 commit 49aed30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public final class BytesToBytesMap {
131131
/**
132132
* Number of keys defined in the map.
133133
*/
134-
private long size;
134+
private int size;
135135

136-
private long growthThreshold;
136+
private int growthThreshold;
137137

138138
private int mask;
139139

@@ -184,7 +184,7 @@ public void finalize() {
184184
/**
185185
* Returns the number of keys defined in the map.
186186
*/
187-
public long size() { return size; }
187+
public int size() { return size; }
188188

189189
/**
190190
* Returns an iterator for iterating over the entries of this map.
@@ -482,7 +482,7 @@ private void allocate(int capacity) {
482482
longArray = new LongArray(allocator.allocate(capacity * 8 * 2));
483483
bitset = new BitSet(allocator.allocate(capacity / 8).zero());
484484

485-
this.growthThreshold = (long) (capacity * loadFactor);
485+
this.growthThreshold = (int) (capacity * loadFactor);
486486
this.mask = capacity - 1;
487487
}
488488

@@ -575,9 +575,9 @@ private void growAndRehash() {
575575
// the similar code path in addWithoutResize.
576576
while (keepGoing) {
577577
if (!bitset.isSet(newPos)) {
578+
bitset.set(newPos);
578579
longArray.set(newPos * 2, keyPointer);
579580
longArray.set(newPos * 2 + 1, valueOffsetPlusHashcode);
580-
bitset.set(newPos);
581581
keepGoing = false;
582582
} else {
583583
newPos = (newPos + step) & mask;

0 commit comments

Comments
 (0)