Skip to content

Commit

Permalink
remove no-args Tuple.of()
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Sep 19, 2024
1 parent f1f734f commit d955992
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/esaulpaugh/headlong/abi/Tuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ public class Tuple implements Iterable<Object> {
this.elements = elements;
}

public static Tuple of() {
return Tuple.EMPTY;
}

/**
* @see Single#of(Object)
* @return a tuple with one element
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/esaulpaugh/headlong/abi/EncodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void fuzzSignatures() throws InterruptedException, ExecutionException, Ti
@Test
public void testFunctionAnnotate() {
final Function foo = Function.parse("foo()");
assertEquals("foo:\nID c2985578", foo.annotateCall(Tuple.of()));
assertEquals("foo:\nID c2985578", foo.annotateCall(Tuple.EMPTY));
assertEquals("", TupleType.EMPTY.annotate(new byte[0]));
final Function f = new Function(
TypeEnum.FUNCTION,
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/com/esaulpaugh/headlong/abi/TupleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void metaTest2() throws Throwable {
@Test
public void testTuple() {
final Tuple emptyA = new Tuple();
final Tuple emptyB = Tuple.of();
final Tuple emptyB = Tuple.from();

assertEquals(Tuple.EMPTY, emptyA);
assertEquals(Tuple.EMPTY, emptyB);
Expand Down Expand Up @@ -612,11 +612,8 @@ public void testToArray() {

@Test
public void testTupleEquals() {
assertEquals(Tuple.EMPTY, Tuple.of());
assertEquals(Tuple.EMPTY, Tuple.from());
assertEquals(Tuple.EMPTY, new Tuple());

final Tuple e = Tuple.of();
final Single<byte[]> s = Single.of(new byte[0]);
final Pair<byte[], String> p = Tuple.of(new byte[1], "75");
final Triple<byte[], String, Long> t = Tuple.of(new byte[2], "75", 75L);
Expand All @@ -637,7 +634,7 @@ public void testTupleEquals() {
final Tuple t7 = Tuple.from(90, new String("_"), t);
final Tuple t8 = t7.get(2);

testEquals(e, t0);
assertEquals(Tuple.EMPTY, t0);
testEquals(s, t1);
testEquals(p, t2);
testEquals(t, t3);
Expand Down

0 comments on commit d955992

Please sign in to comment.