Skip to content

Commit 7b711e0

Browse files
committed
Remove obsolete method 'PTuple.compareTo'.
1 parent ac76844 commit 7b711e0

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/tuple/PTuple.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727

2828
import com.oracle.graal.python.builtins.objects.type.PythonClass;
2929
import com.oracle.graal.python.runtime.sequence.PImmutableSequence;
30-
import com.oracle.graal.python.runtime.sequence.PSequence;
31-
import com.oracle.graal.python.runtime.sequence.SequenceUtil;
3230
import com.oracle.graal.python.runtime.sequence.storage.ObjectSequenceStorage;
3331
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
3432
import com.oracle.truffle.api.CompilerAsserts;
3533
import com.oracle.truffle.api.CompilerDirectives;
3634
import com.oracle.truffle.api.nodes.UnexpectedResultException;
3735

38-
public final class PTuple extends PImmutableSequence implements Comparable<Object> {
36+
public final class PTuple extends PImmutableSequence {
3937

4038
private SequenceStorage store;
4139

@@ -102,11 +100,6 @@ public void setSequenceStorage(SequenceStorage store) {
102100
this.store = store;
103101
}
104102

105-
@Override
106-
public int compareTo(Object o) {
107-
return SequenceUtil.cmp(this, (PSequence) o);
108-
}
109-
110103
@Override
111104
public boolean equals(Object other) {
112105
CompilerAsserts.neverPartOfCompilation();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/SequenceUtil.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -91,29 +91,6 @@ public static final int sliceLength(int start, int stop, long step) {
9191
return ret;
9292
}
9393

94-
/*
95-
* Compare the specified object/length pairs.
96-
*
97-
* @return value >= 0 is the index where the sequences differs. -1: reached the end of sequence1
98-
* without a difference -2: reached the end of both sequences without a difference -3: reached
99-
* the end of sequence2 without a difference
100-
*/
101-
public static int cmp(PSequence sequence1, PSequence sequence2) {
102-
throw new UnsupportedOperationException();
103-
// int length1 = sequence1.len();
104-
// int length2 = sequence2.len();
105-
//
106-
// for (int i = 0; i < length1 && i < length2; i++) {
107-
// if (!sequence1.getItem(i).equals(sequence2.getItem(i))) {
108-
// return i;
109-
// }
110-
// }
111-
// if (length1 == length2) {
112-
// return -2;
113-
// }
114-
// return length1 < length2 ? -1 : -3;
115-
}
116-
11794
public static int normalizeIndex(int index, int length, String outOfBoundsMessage) {
11895
int normalized = normalizeIndexUnchecked(index, length);
11996
if (normalized < 0 || normalized >= length) {

0 commit comments

Comments
 (0)