🔥 Remove unnecessary function
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Sep 2021 16:32:40 +0000 (18:32 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 25 Sep 2021 16:32:40 +0000 (18:32 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java
src/main/java/net/pterodactylus/xdcc/data/Channel.java

index 649db75..8bc923f 100644 (file)
@@ -22,7 +22,6 @@ import static net.pterodactylus.irc.event.ChannelNotJoined.Reason.banned;
 import static net.pterodactylus.irc.event.ChannelNotJoined.Reason.inviteOnly;
 import static net.pterodactylus.irc.event.ChannelNotJoined.Reason.registeredNicknamesOnly;
 import static net.pterodactylus.irc.util.MessageCleaner.getDefaultInstance;
-import static net.pterodactylus.xdcc.data.Channel.TO_NETWORK;
 import static net.pterodactylus.xdcc.data.Download.FILTER_RUNNING;
 
 import java.io.File;
@@ -186,7 +185,7 @@ public class Core extends AbstractExecutionThreadService {
         * @return All defined networks
         */
        public Collection<Network> networks() {
-               return FluentIterable.from(channels).transform(TO_NETWORK).toSet();
+               return FluentIterable.from(channels).transform(Channel::network).toSet();
        }
 
        /**
index f4c8d01..68e0cb6 100644 (file)
@@ -28,14 +28,6 @@ import com.google.common.base.Function;
  */
 public class Channel {
 
-       /** Function to convert a channel to its network. */
-       public static final Function<Channel, Network> TO_NETWORK = new Function<Channel, Network>() {
-               @Override
-               public Network apply(Channel channel) {
-                       return channel.network();
-               }
-       };
-
        /** The network this channel belongs to. */
        private final Network network;