From 15da2f85adcdd9e05eba982e36753bb056de342e Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Fri, 23 Oct 2020 16:05:39 +0000
Subject: [PATCH] SSU: Minor cleanup of congestion checkin

---
 .../src/net/i2p/router/transport/udp/PeerState.java  | 12 ++----------
 .../net/i2p/router/transport/udp/UDPTransport.java   |  2 +-
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/router/java/src/net/i2p/router/transport/udp/PeerState.java b/router/java/src/net/i2p/router/transport/udp/PeerState.java
index 4b03005d8e..b387c42474 100644
--- a/router/java/src/net/i2p/router/transport/udp/PeerState.java
+++ b/router/java/src/net/i2p/router/transport/udp/PeerState.java
@@ -1712,16 +1712,8 @@ public class PeerState {
                     if (should) {
                         if (_log.shouldLog(Log.DEBUG))
                             _log.debug("Allocate sending (OLD) to " + _remotePeer + ": " + state.getMessageId());
-                        /*
-                        while (iter.hasNext()) {
-                            OutboundMessageState later = (OutboundMessageState)iter.next();
-                            OutNetMessage msg = later.getMessage();
-                            if (msg != null)
-                                msg.timestamp("not reached for allocation " + msgs.size() + " other peers");
-                        }
-                         */
                         if (rv == null)
-                            rv = new ArrayList<OutboundMessageState>(_outboundMessages.size());
+                            rv = new ArrayList<OutboundMessageState>((1 + _outboundMessages.size()) / 2);
                         rv.add(state);
                         if (rv.size() >= _outboundMessages.size() / 2)
                             return rv;
@@ -1740,7 +1732,7 @@ public class PeerState {
                         return rv;
                     } 
                 }
-                return null;
+                return rv;
             }
             // Peek at head of _outboundQueue and see if we can send it.
             // If so, pull it off, put it in _outbundMessages, test
diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
index 370cbda7fe..378cabd644 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java
@@ -347,7 +347,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
     }
 
     /**
-     * @returns the instance of OutboundMessageFragments
+     * @return the instance of OutboundMessageFragments
      * @since 0.9.48
      */
     OutboundMessageFragments getOMF() {
-- 
GitLab