Skip to content

Commit cfde06f

Browse files
committed
Remove obsolete method 'PList.sort' and 'SequenceStorage.sort'.
1 parent 351ae11 commit cfde06f

14 files changed

+0
-102
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/list/PList.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ public final String toString() {
7979
return buf.toString();
8080
}
8181

82-
public final void sort() {
83-
store.sort();
84-
}
85-
8682
@Override
8783
public final int len() {
8884
return store.length();

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -331,26 +331,6 @@ public void reverse() {
331331
}
332332
}
333333

334-
// TODO: Should use Collection for sorting boolean
335-
@Override
336-
public void sort() {
337-
boolean[] copy = Arrays.copyOf(values, length);
338-
int count = 0;
339-
for (boolean b : copy) {
340-
if (!b)
341-
count++;
342-
}
343-
for (int i = 0; i < length; i++) {
344-
if (count != 0) {
345-
copy[i] = false;
346-
count--;
347-
} else
348-
copy[i] = true;
349-
}
350-
values = copy;
351-
minimizeCapacity();
352-
}
353-
354334
@Override
355335
public Object getIndicativeValue() {
356336
return 0;

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,6 @@ public void reverse() {
505505
}
506506
}
507507

508-
@Override
509-
public void sort() {
510-
byte[] copy = Arrays.copyOf(values, length);
511-
Arrays.sort(copy);
512-
values = copy;
513-
minimizeCapacity();
514-
}
515-
516508
@Override
517509
public Object getIndicativeValue() {
518510
return 0;

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ public void reverse() {
154154
throw new UnsupportedOperationException();
155155
}
156156

157-
@Override
158-
public void sort() {
159-
throw new UnsupportedOperationException();
160-
}
161-
162157
@Override
163158
public Object getIndicativeValue() {
164159
return '\0';

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,6 @@ public void reverse() {
334334
}
335335
}
336336

337-
@Override
338-
public void sort() {
339-
double[] copy = Arrays.copyOf(values, length);
340-
Arrays.sort(copy);
341-
values = copy;
342-
minimizeCapacity();
343-
}
344-
345337
@Override
346338
public Object getIndicativeValue() {
347339
return .0;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,6 @@ public void extend(SequenceStorage other) throws SequenceStoreException {
173173
public void reverse() {
174174
}
175175

176-
@Override
177-
public void sort() {
178-
}
179-
180176
@Override
181177
public boolean equals(SequenceStorage other) {
182178
return other == EmptySequenceStorage.INSTANCE;

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,6 @@ public void reverse() {
338338
}
339339
}
340340

341-
@Override
342-
public void sort() {
343-
int[] copy = Arrays.copyOf(values, length);
344-
Arrays.sort(copy);
345-
values = copy;
346-
minimizeCapacity();
347-
}
348-
349341
@Override
350342
public Object getIndicativeValue() {
351343
return 0;

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,6 @@ public void reverse() {
370370
}
371371
}
372372

373-
@Override
374-
public void sort() {
375-
// TODO: need to be tested
376-
Object[] copy = Arrays.copyOf(values, length);
377-
Arrays.sort(copy);
378-
values = (PList[]) copy;
379-
minimizeCapacity();
380-
}
381-
382373
@Override
383374
public Object getIndicativeValue() {
384375
return length > 0 ? values[0] : null;

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,6 @@ public void reverse() {
349349
}
350350
}
351351

352-
@Override
353-
public void sort() {
354-
long[] copy = Arrays.copyOf(values, length);
355-
Arrays.sort(copy);
356-
values = copy;
357-
minimizeCapacity();
358-
}
359-
360352
@Override
361353
public Object getIndicativeValue() {
362354
return 0;

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ public void reverse() {
189189
throw new AssertionError("should not reach");
190190
}
191191

192-
@Override
193-
public void sort() {
194-
throw new AssertionError("should not reach");
195-
}
196-
197192
@Override
198193
public boolean equals(SequenceStorage other) {
199194
CompilerAsserts.neverPartOfCompilation();

0 commit comments

Comments
 (0)