Skip to content

Commit

Permalink
Remove variable assignment just before returning it
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Feb 4, 2024
1 parent 19649cd commit 0fd7b59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
13 changes: 4 additions & 9 deletions src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
Original file line number Diff line number Diff line change
Expand Up @@ -1069,9 +1069,7 @@ public static long hash64(final byte[] data, final int offset, final int length,

// finalization
hash ^= length;
hash = fmix64(hash);

return hash;
return fmix64(hash);
}

/**
Expand Down Expand Up @@ -1113,8 +1111,7 @@ public static long hash64(final int data) {
hash ^= k1;
// finalization
hash ^= Integer.BYTES;
hash = fmix64(hash);
return hash;
return fmix64(hash);
}

/**
Expand Down Expand Up @@ -1158,8 +1155,7 @@ public static long hash64(final long data) {
hash = Long.rotateLeft(hash, R2) * M + N1;
// finalization
hash ^= Long.BYTES;
hash = fmix64(hash);
return hash;
return fmix64(hash);
}

/**
Expand Down Expand Up @@ -1204,8 +1200,7 @@ public static long hash64(final short data) {

// finalization
hash ^= Short.BYTES;
hash = fmix64(hash);
return hash;
return fmix64(hash);
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/apache/commons/codec/digest/UnixCrypt.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,9 @@ private static int fourBytesToInt(final byte[] b, int offset) {
return value;
}

private static int hPermOp(int a, final int n, final int m) {
private static int hPermOp(final int a, final int n, final int m) {
final int t = (a << 16 - n ^ a) & m;
a = a ^ t ^ t >>> 16 - n;
return a;
return a ^ t ^ t >>> 16 - n;
}

private static void intToFourBytes(final int iValue, final byte[] b, int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ String cleanName(final String name) {
}

upperName = removeAccents(upperName);
upperName = upperName.replaceAll("\\s+", EMPTY);

return upperName;
return upperName.replaceAll("\\s+", EMPTY);
}

/**
Expand Down Expand Up @@ -143,10 +141,7 @@ public final String encode(String name) {
// 2. Remove second consonant from any double consonant
name = removeDoubleConsonants(name);

// 3. Reduce codex to 6 letters by joining the first 3 and last 3 letters
name = getFirst3Last3(name);

return name;
return getFirst3Last3(name);
}

/**
Expand Down

0 comments on commit 0fd7b59

Please sign in to comment.