Skip to content

Commit

Permalink
What an ugly name for a public API (COMPARATOR)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 13, 2016
1 parent 9f536a3 commit 1e993f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
11 changes: 1 addition & 10 deletions src/main/java/com/frostwire/jlibtorrent/Address.java
Expand Up @@ -2,8 +2,6 @@

import com.frostwire.jlibtorrent.swig.address;

import java.util.Comparator;

/**
* @author gubatron
* @author aldenml
Expand All @@ -26,13 +24,6 @@ public String toString() {
}

public static int compare(Address a1, Address a2) {
return COMPARATOR.compare(a1, a2);
return address.compare(a1.addr, a2.addr);
}

public static final Comparator<Address> COMPARATOR = new Comparator<Address>() {
@Override
public int compare(Address o1, Address o2) {
return address.compare(o1.addr, o2.addr);
}
};
}
4 changes: 2 additions & 2 deletions src/main/java/com/frostwire/jlibtorrent/DHTSettings.java
Expand Up @@ -98,7 +98,7 @@ public void setMaxFailCount(int value) {
*
* @return
*/
public int getMaxTorrents() {
public int maxTorrents() {
return s.getMax_torrents();
}

Expand All @@ -109,7 +109,7 @@ public int getMaxTorrents() {
*
* @param value
*/
public void setMaxTorrents(int value) {
public void maxTorrents(int value) {
s.setMax_torrents(value);
}

Expand Down
11 changes: 3 additions & 8 deletions src/main/java/com/frostwire/jlibtorrent/Sha1Hash.java
Expand Up @@ -2,8 +2,6 @@

import com.frostwire.jlibtorrent.swig.sha1_hash;

import java.util.Comparator;

/**
* This type holds a SHA-1 digest or any other kind of 20 byte
* sequence. It implements a number of convenience functions, such
Expand Down Expand Up @@ -110,10 +108,7 @@ public static Sha1Hash min() {
return new Sha1Hash(sha1_hash.min());
}

public static final Comparator<Sha1Hash> COMPARATOR = new Comparator<Sha1Hash>() {
@Override
public int compare(Sha1Hash o1, Sha1Hash o2) {
return sha1_hash.compare(o1.h, o2.h);
}
};
public static int compare(Sha1Hash h1, Sha1Hash h2) {
return sha1_hash.compare(h1.h, h2.h);
}
}

0 comments on commit 1e993f8

Please sign in to comment.