You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/02/04 19:36:37 UTC

(commons-vfs) 21/26: Remove variable assignment just before returning it

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git

commit 5114546e23a887191016ee3205391865daa518fa
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 4 14:32:51 2024 -0500

    Remove variable assignment just before returning it
---
 .../org/apache/commons/vfs2/auth/StaticUserAuthenticator.java     | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
index 6ceccb81..24283fd0 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
@@ -77,9 +77,7 @@ public class StaticUserAuthenticator implements UserAuthenticator, Comparable<St
     public int compareTo(final StaticUserAuthenticator other) {
         int result = compareStringOrNull(domain, other.domain);
         result = result == 0 ? compareStringOrNull(userName, other.userName) : result;
-        result = result == 0 ? compareStringOrNull(password, other.password) : result;
-
-        return result;
+        return result == 0 ? compareStringOrNull(password, other.password) : result;
     }
 
     /**
@@ -117,9 +115,7 @@ public class StaticUserAuthenticator implements UserAuthenticator, Comparable<St
         int result = 1;
         result = prime * result + (domain == null ? 0 : domain.hashCode());
         result = prime * result + (password == null ? 0 : password.hashCode());
-        result = prime * result + (userName == null ? 0 : userName.hashCode());
-
-        return result;
+        return prime * result + (userName == null ? 0 : userName.hashCode());
     }
 
     @Override