From d81bff267a643e23111785af51a6b339eb29b89a Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Mon, 12 May 2008 13:50:15 +0000
Subject: [PATCH]     * Outbound message:       - Tweak the cache key for
 efficiency

---
 .../i2p/router/message/OutboundClientMessageOneShotJob.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java b/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
index 03b31bc368..8dba7275dc 100644
--- a/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
+++ b/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
@@ -580,11 +580,12 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
 
     /**
      * String used to cache things with based on source + dest
+     * Put the dest first to make string matching faster
      */
     private String _hashPair;
     private String hashPair() {
         if (_hashPair == null)
-            _hashPair = _from.calculateHash().toBase64() + _to.calculateHash().toBase64();
+            _hashPair = _to.calculateHash().toBase64() + _from.calculateHash().toBase64();
         return _hashPair;
     }
 
@@ -594,7 +595,7 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
      * 44 = 32 * 4 / 3
      */
     private Hash sourceFromHashPair(String s) {
-        return new Hash(Base64.decode(s.substring(0, 44)));
+        return new Hash(Base64.decode(s.substring(44, 88)));
     }
 
     /**
-- 
GitLab