You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/12/13 02:39:35 UTC

[james-project] 19/27: PROTOCOLS-120 Avoid some variable reallocation in StatusResponseEncoder

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit a0508e93a9e649bad6702ea788bd08f69c6bb59a
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Dec 9 10:03:06 2019 +0700

    PROTOCOLS-120 Avoid some variable reallocation in StatusResponseEncoder
---
 .../org/apache/james/imap/encode/StatusResponseEncoder.java | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/encode/StatusResponseEncoder.java b/protocols/imap/src/main/java/org/apache/james/imap/encode/StatusResponseEncoder.java
index 9c920b2..8f0435e 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/encode/StatusResponseEncoder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/encode/StatusResponseEncoder.java
@@ -31,7 +31,6 @@ import org.apache.james.imap.api.display.Localizer;
 import org.apache.james.imap.api.message.response.StatusResponse;
 import org.apache.james.imap.api.message.response.StatusResponse.ResponseCode;
 import org.apache.james.imap.api.message.response.StatusResponse.Type;
-import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.message.response.ImmutableStatusResponse;
 
 public class StatusResponseEncoder implements ImapResponseEncoder<ImmutableStatusResponse> {
@@ -110,22 +109,18 @@ public class StatusResponseEncoder implements ImapResponseEncoder<ImmutableStatu
     }
 
     private String asString(StatusResponse.ResponseCode code) {
-        final String result;
         if (code == null) {
-            result = null;
+            return null;
         } else {
-            result = code.getCode();
+            return code.getCode();
         }
-        return result;
     }
 
     private String asString(StatusResponse.Type type) {
-        final String result;
         if (type == null) {
-            result = null;
+            return null;
         } else {
-            result = type.getCode();
+            return type.getCode();
         }
-        return result;
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org