Skip to content

Commit

Permalink
LNGVector: removed buggy and unused method toArray
Browse files Browse the repository at this point in the history
  • Loading branch information
rouven-walter committed Jul 23, 2020
1 parent 024f310 commit 10a4696
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/main/java/org/logicng/collections/LNGVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,6 @@ public void sortReverse(final Comparator<T> comparator) {
}
}

/**
* Returns this vector's contents as an array.
* @return the array
*/
public T[] toArray() {
return Arrays.copyOf(this.elements, this.size);
}

/**
* Ensures that this vector has the given size. If not - the size is doubled and the old elements are copied.
* @param newSize the size to ensure
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/logicng/collections/LNGVectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ public void testToArray() {
}
}
v1.shrinkTo(500);
assertThat(v1.toArray()).containsExactly(expected);
for (int i = 0; i < expected.length; i++) {
assertThat(v1.get(i)).isEqualTo(expected[i]);
}
}

@Test
Expand Down

0 comments on commit 10a4696

Please sign in to comment.