Skip to content

Commit 1eee1c3

Browse files
committed
Remove unused increaseCapacityExact
1 parent 02c4dfa commit 1eee1c3

File tree

8 files changed

+6
-59
lines changed

8 files changed

+6
-59
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/BasicSequenceStorage.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public final void ensureCapacity(int newCapacity) throws ArithmeticException {
7373

7474
protected abstract void increaseCapacityExactWithCopy(int newCapacity);
7575

76-
protected abstract void increaseCapacityExact(int newCapacity);
77-
7876
public void minimizeCapacity() {
7977
capacity = length;
8078
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/BoolSequenceStorage.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ protected void increaseCapacityExactWithCopy(int newCapacity) {
5959
capacity = values.length;
6060
}
6161

62-
@Override
63-
protected void increaseCapacityExact(int newCapacity) {
64-
values = new boolean[newCapacity];
65-
capacity = values.length;
66-
}
67-
6862
@Override
6963
public SequenceStorage copy() {
7064
return new BoolSequenceStorage(PythonUtils.arrayCopyOf(values, length));
@@ -77,7 +71,7 @@ public BasicSequenceStorage createEmpty(int newLength) {
7771

7872
@Override
7973
public Object[] getInternalArray() {
80-
/**
74+
/*
8175
* Have to box and copy.
8276
*/
8377
Object[] boxed = new Object[length];

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ByteSequenceStorage.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
2929
import static com.oracle.graal.python.runtime.exception.PythonErrorType.ValueError;
3030

31-
import java.nio.ByteBuffer;
3231
import java.nio.ByteOrder;
3332
import java.util.Arrays;
3433

3534
import com.oracle.graal.python.builtins.objects.buffer.PythonBufferAccessLibrary;
3635
import com.oracle.graal.python.nodes.ErrorMessages;
3736
import com.oracle.graal.python.nodes.PRaiseNode;
3837
import com.oracle.graal.python.util.PythonUtils;
39-
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
4038
import com.oracle.truffle.api.library.ExportLibrary;
4139
import com.oracle.truffle.api.library.ExportMessage;
4240

@@ -67,12 +65,6 @@ protected void increaseCapacityExactWithCopy(int newCapacity) {
6765
capacity = values.length;
6866
}
6967

70-
@Override
71-
protected void increaseCapacityExact(int newCapacity) {
72-
values = new byte[newCapacity];
73-
capacity = values.length;
74-
}
75-
7668
@Override
7769
public SequenceStorage copy() {
7870
return new ByteSequenceStorage(PythonUtils.arrayCopyOf(values, length));
@@ -85,7 +77,7 @@ public BasicSequenceStorage createEmpty(int newCapacity) {
8577

8678
@Override
8779
public Object[] getInternalArray() {
88-
/**
80+
/*
8981
* Have to box and copy.
9082
*/
9183
Object[] boxed = new Object[length];
@@ -97,19 +89,12 @@ public Object[] getInternalArray() {
9789
return boxed;
9890
}
9991

100-
@TruffleBoundary(allowInlining = true, transferToInterpreterOnException = false)
101-
public ByteBuffer getBufferView() {
102-
ByteBuffer view = ByteBuffer.wrap(values);
103-
view.limit(values.length);
104-
return view;
105-
}
106-
10792
@Override
10893
public Object getItemNormalized(int idx) {
10994
return getIntItemNormalized(idx);
11095
}
11196

112-
public final byte getByteItemNormalized(int idx) {
97+
public byte getByteItemNormalized(int idx) {
11398
return values[idx];
11499
}
115100

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/DoubleSequenceStorage.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ protected void increaseCapacityExactWithCopy(int newCapacity) {
6161
capacity = values.length;
6262
}
6363

64-
@Override
65-
protected void increaseCapacityExact(int newCapacity) {
66-
values = new double[newCapacity];
67-
capacity = values.length;
68-
}
69-
7064
@Override
7165
public SequenceStorage copy() {
7266
return new DoubleSequenceStorage(PythonUtils.arrayCopyOf(values, length));
@@ -79,7 +73,7 @@ public BasicSequenceStorage createEmpty(int newCapacity) {
7973

8074
@Override
8175
public Object[] getInternalArray() {
82-
/**
76+
/*
8377
* Have to box and copy.
8478
*/
8579
Object[] boxed = new Object[length];

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/IntSequenceStorage.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ protected void increaseCapacityExactWithCopy(int newCapacity) {
6161
capacity = values.length;
6262
}
6363

64-
@Override
65-
protected void increaseCapacityExact(int newCapacity) {
66-
values = new int[newCapacity];
67-
capacity = values.length;
68-
}
69-
7064
@Override
7165
public SequenceStorage copy() {
7266
return new IntSequenceStorage(PythonUtils.arrayCopyOf(values, length));
@@ -79,7 +73,7 @@ public BasicSequenceStorage createEmpty(int newCapacity) {
7973

8074
@Override
8175
public Object[] getInternalArray() {
82-
/**
76+
/*
8377
* Have to box and copy.
8478
*/
8579
Object[] boxed = new Object[length];

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/LongSequenceStorage.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ protected void increaseCapacityExactWithCopy(int newCapacity) {
6363
capacity = values.length;
6464
}
6565

66-
@Override
67-
protected void increaseCapacityExact(int newCapacity) {
68-
values = new long[newCapacity];
69-
capacity = values.length;
70-
}
71-
7266
@Override
7367
public SequenceStorage copy() {
7468
return new LongSequenceStorage(PythonUtils.arrayCopyOf(values, length));
@@ -81,7 +75,7 @@ public BasicSequenceStorage createEmpty(int newCapacity) {
8175

8276
@Override
8377
public Object[] getInternalArray() {
84-
/**
78+
/*
8579
* Have to box and copy.
8680
*/
8781
Object[] boxed = new Object[length];

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/MroSequenceStorage.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,6 @@ public void increaseCapacityExactWithCopy(int newCapacity) {
166166
throw CompilerDirectives.shouldNotReachHere();
167167
}
168168

169-
@SuppressWarnings("unused")
170-
@Override
171-
public void increaseCapacityExact(int newCapacity) {
172-
throw CompilerDirectives.shouldNotReachHere();
173-
}
174-
175169
@SuppressWarnings("unused")
176170
@Override
177171
public void reverse() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ObjectSequenceStorage.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ public void increaseCapacityExactWithCopy(int newCapacity) {
121121
capacity = values.length;
122122
}
123123

124-
@Override
125-
public void increaseCapacityExact(int newCapacity) {
126-
values = new Object[newCapacity];
127-
capacity = values.length;
128-
}
129-
130124
@Override
131125
public void reverse() {
132126
if (length > 0) {

0 commit comments

Comments
 (0)