Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertp committed Dec 5, 2022
1 parent c74f617 commit c645b67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ public final class Array implements TruffleObject {
*
* @param items the element values
*/
@Builtin.Method(
expandVarargs = 4,
description = "Creates an array with given elements.",
autoRegister = false)
@Builtin.Method(expandVarargs = 4, description = "Creates an array with given elements.", autoRegister = false)
public Array(Object... items) {
this.items = items;
this.withWarnings = hasWarningElements(items);
Expand All @@ -46,9 +43,7 @@ public Array(Object... items) {
*
* @param size the size of the created array.
*/
@Builtin.Method(
description = "Creates an uninitialized array of a given size.",
autoRegister = false)
@Builtin.Method(description = "Creates an uninitialized array of a given size.", autoRegister = false)
public Array(long size) {
this.items = new Object[(int) size];
}
Expand Down Expand Up @@ -175,8 +170,8 @@ Warning[] getWarnings(Node location) {
Array removeWarnings() {
Object[] items = new Object[this.items.length];
for (int i = 0; i < this.items.length; i++) {
if (this.items[i] instanceof WithWarnings) {
items[i] = ((WithWarnings) this.items[i]).getValue();
if (this.items[i] instanceof WithWarnings w) {
items[i] = w.getValue();
} else {
items[i] = this.items[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ private interface ArrayRopeSegment<T> {
void appendTo(T[] builder, int start);

int size();

boolean isEmpty();
}

private static final class ArraySegment<T> implements ArrayRopeSegment<T> {
Expand All @@ -77,11 +75,6 @@ public int size() {
return elements.length;
}

@Override
public boolean isEmpty() {
return elements.length == 0;
}

@Override
public String toString() {
return "ArraySegment{" + "elements=" + Arrays.toString(elements) + '}';
Expand Down Expand Up @@ -113,11 +106,6 @@ public int size() {
return cachedSize;
}

@Override
public boolean isEmpty() {
return left.isEmpty() && right.isEmpty();
}

@Override
public String toString() {
return "ConcatSegment{"
Expand Down

0 comments on commit c645b67

Please sign in to comment.